History

bpf: Remove bpf_image tree

Now that we have all the objects (bpf_prog, bpf_trampoline, bpf_dispatcher) linked in bpf_tree, there's no need to have separate bpf_image tree for images. Reverting the bpf_image tree together with struct bpf_image, because it's no longer needed. Also removing bpf_image_alloc function and adding the original bpf_jit_alloc_exec_page interface instead. The kernel_text_address function can now rely only on is_bpf_text_address, because it checks the bpf_tree that contains all the objects. Keeping bpf_image_ksym_add and bpf_image_ksym_del because they are useful wrappers with perf's ksymbol interface calls.

Jiri Olsa committed 6 years ago

Commit 7ac88eb1 parent 517b75e4 files · +13 −84Browse files

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

Unified · Split

include/linux/bpf.h+1−7
@@ -583,14 +583,8 @@ void bpf_trampoline_put(struct bpf_trampoline *tr); · 582 unmodified lines
583#define BPF_DISPATCHER_PTR(name) (&bpf_dispatcher_##name)583#define BPF_DISPATCHER_PTR(name) (&bpf_dispatcher_##name)
584void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,584void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,
585 struct bpf_prog *to);585 struct bpf_prog *to);
586struct bpf_image {
587 struct latch_tree_node tnode;
588 unsigned char data[];
589};
590#define BPF_IMAGE_SIZE (PAGE_SIZE - sizeof(struct bpf_image))
591bool is_bpf_image_address(unsigned long address);
592void *bpf_image_alloc(void);
593/* Called only from JIT-enabled code, so there's no need for stubs. */586/* Called only from JIT-enabled code, so there's no need for stubs. */
587void *bpf_jit_alloc_exec_page(void);
594void bpf_image_ksym_add(void *data, struct bpf_ksym *ksym);588void bpf_image_ksym_add(void *data, struct bpf_ksym *ksym);
595void bpf_image_ksym_del(struct bpf_ksym *ksym);589void bpf_image_ksym_del(struct bpf_ksym *ksym);
596void bpf_ksym_add(struct bpf_ksym *ksym);590void bpf_ksym_add(struct bpf_ksym *ksym);