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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -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 | ||
| 1160 | enum bpf_text_poke_type { | ||
| 1161 | BPF_MOD_NOP_TO_CALL, | ||
| 1162 | BPF_MOD_CALL_TO_CALL, | ||
| 1163 | BPF_MOD_CALL_TO_NOP, | ||
| 1164 | }; | ||
| 1165 | int 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 */ |