History

bpf: Add bpf_arch_text_poke() helper

Add bpf_arch_text_poke() helper that is used by BPF trampoline logic to patch nops/calls in kernel text into calls into BPF trampoline and to patch calls/nops inside BPF programs too.

Alexei Starovoitov committed 7 years ago

Commit 5964b201 parent 3b2744e3 files · +65 −0Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/bpf.h+8−0
@@ -1157,4 +1157,12 @@ static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type, · 1156 unmodified lines
1157}1157}
1158#endif /* CONFIG_INET */1158#endif /* CONFIG_INET */
1159 1159
1160enum bpf_text_poke_type {
1161 BPF_MOD_NOP_TO_CALL,
1162 BPF_MOD_CALL_TO_CALL,
1163 BPF_MOD_CALL_TO_NOP,
1164};
1165int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
1166 void *addr1, void *addr2);
1167
1160#endif /* _LINUX_BPF_H */1168#endif /* _LINUX_BPF_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t