]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Use given function address for trampoline ip arg
authorJiri Olsa <jolsa@kernel.org>
Mon, 26 Sep 2022 15:33:37 +0000 (17:33 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Sep 2022 03:30:39 +0000 (20:30 -0700)
commit5af3bc59708d12e2cfa16d8af9408c4a94bfeee5
treeb743f9ceae690907f1996a6d99e22d4964c231a4
parente4f4455e355911a2bc0497f4173930ed947fae24
bpf: Use given function address for trampoline ip arg

Using function address given at the generation time as the trampoline
ip argument. This way we get directly the function address that we
need, so we don't need to:
  - read the ip from the stack
  - subtract X86_PATCH_SIZE
  - subtract ENDBR_INSN_SIZE if CONFIG_X86_KERNEL_IBT is enabled
    which is not even implemented yet ;-)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220926153340.1621984-4-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/net/bpf_jit_comp.c