]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Make BPF trampoline use register_ftrace_direct() API
authorAlexei Starovoitov <ast@kernel.org>
Mon, 9 Dec 2019 00:01:13 +0000 (16:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 11 Dec 2019 23:18:08 +0000 (15:18 -0800)
commit7f21d69fcf169314da591c933fb1940415686a0b
tree7d92e7ddbdd5cc48543536c6311b6ea292c7f949
parentb9aeb728959ab3b9567cf2e6b7e1dc0b232b5cd7
bpf: Make BPF trampoline use register_ftrace_direct() API

Make BPF trampoline attach its generated assembly code to kernel functions via
register_ftrace_direct() API. It helps ftrace-based tracers co-exist with BPF
trampoline on the same kernel function. It also switches attaching logic from
arch specific text_poke to generic ftrace that is available on many
architectures. text_poke is still necessary for bpf-to-bpf attach and for
bpf_tail_call optimization.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191209000114.1876138-3-ast@kernel.org
include/linux/bpf.h
kernel/bpf/trampoline.c