OSDN Git Service

bpf: Refactor trampoline update code
authorKP Singh <kpsingh@google.com>
Wed, 4 Mar 2020 19:18:47 +0000 (20:18 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 4 Mar 2020 21:41:05 +0000 (13:41 -0800)
commit88fd9e5352fe05f7fe57778293aebd4cd106960b
treea8bc1ce304a0f7e5594666995fe5d3863dbda3e5
parentcc6fa771024ffdb428bdf25a94309cf21e8ef1b9
bpf: Refactor trampoline update code

As we need to introduce a third type of attachment for trampolines, the
flattened signature of arch_prepare_bpf_trampoline gets even more
complicated.

Refactor the prog and count argument to arch_prepare_bpf_trampoline to
use bpf_tramp_progs to simplify the addition and accounting for new
attachment types.

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200304191853.1529-2-kpsingh@chromium.org
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
kernel/bpf/bpf_struct_ops.c
kernel/bpf/trampoline.c