]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite82e3ae73d7a1a828fd78eda96f96ff82c6611f7
treea8bc1ce304a0f7e5594666995fe5d3863dbda3e5
parent0f7abbd02163d1e34c3716ce7df0e28656b3a8ed
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