Skip to content

bpf: enable x86 fentry on tail-called programs

Takeru Hayasaka bpf linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf, x86: patch tail-call fentry slot on non-IBT JITsarch/x86/net/bpf_jit_comp.c+44 -312 replies
2/2selftests/bpf: cover fentry on tailcalled programstools/testing/selftests/bpf/prog_tests/tailcalls.c tools/testing/selftests/bpf/progs/tailcall_fentry_probe.c tools/testing/selftests/bpf/progs/tailcall_fentry_target.c+153 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] bpf: enable x86 fentry on tail-called programs

This series enables fentry on x86 BPF programs reached via tail calls and adds a focused selftest for the expected behavior.

Patch 1 fixes the x86 mirrored text-poke lookup so the tail-call landing slot is patched on both IBT and non-IBT JITs.

Patch 2 adds a selftest that checks both direct entry and tail-called entry for a tailcall callee with fentry attached.

Takeru Hayasaka (2):
bpf, x86: patch tail-call fentry slot on non-IBT JITs selftests/bpf: cover fentry on tailcalled programs

 arch/x86/net/bpf_jit_comp.c                   |  47 +++++++-
 .../selftests/bpf/prog_tests/tailcalls.c      | 110 ++++++++++++++++++
 .../bpf/progs/tailcall_fentry_probe.c         |  16 +++
 .../bpf/progs/tailcall_fentry_target.c        |  27 +++++
 4 files changed, 197 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/tailcall_fentry_probe.c
 create mode 100644 tools/testing/selftests/bpf/progs/tailcall_fentry_target.c
Signature · 1 line
2.43.0