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

From: Takeru Hayasaka

Date: Fri Mar 27 2026 - 10:20:58 EST


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

--
2.43.0