Separating /proc/kallsyms add/del code and adding bpf_ksym_add/del functions for that. Moving bpf_prog_ksym_node_add/del functions to __bpf_ksym_add/del and changing their argument to 'struct bpf_ksym' object. This way we can call them for other bpf objects types like trampoline and dispatcher.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -584,6 +584,9 @@ struct bpf_image { · 583 unmodified lines | ||
| 584 | 584 | #define BPF_IMAGE_SIZE (PAGE_SIZE - sizeof(struct bpf_image)) |
| 585 | 585 | bool is_bpf_image_address(unsigned long address); |
| 586 | 586 | void *bpf_image_alloc(void); |
| 587 | +/* Called only from JIT-enabled code, so there's no need for stubs. */ | |
| 588 | +void bpf_ksym_add(struct bpf_ksym *ksym); | |
| 589 | +void bpf_ksym_del(struct bpf_ksym *ksym); | |
| 587 | 590 | #else |
| 588 | 591 | static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key) |
| 589 | 592 | { |