bpf, x86: Generate trampolines from bpf_tramp_links
authorKui-Feng Lee <kuifeng@fb.com>
Tue, 10 May 2022 20:59:19 +0000 (13:59 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 11 May 2022 00:50:40 +0000 (17:50 -0700)
commitf7e0beaf39d3868dc700d4954b26cf8443c5d423
tree61ebf37dc2ffb763514ea1d9314bb915e6ca6618
parentcb411545309e69753bfa4805060c17faaa25500d
bpf, x86: Generate trampolines from bpf_tramp_links

Replace struct bpf_tramp_progs with struct bpf_tramp_links to collect
struct bpf_tramp_link(s) for a trampoline.  struct bpf_tramp_link
extends bpf_link to act as a linked list node.

arch_prepare_bpf_trampoline() accepts a struct bpf_tramp_links to
collects all bpf_tramp_link(s) that a trampoline should call.

Change BPF trampoline and bpf_struct_ops to pass bpf_tramp_links
instead of bpf_tramp_progs.

Signed-off-by: Kui-Feng Lee <kuifeng@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220510205923.3206889-2-kuifeng@fb.com
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
include/linux/bpf_types.h
include/uapi/linux/bpf.h
kernel/bpf/bpf_struct_ops.c
kernel/bpf/syscall.c
kernel/bpf/trampoline.c
net/bpf/bpf_dummy_struct_ops.c
tools/bpf/bpftool/link.c
tools/include/uapi/linux/bpf.h