]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc64/bpf: Moving tail_call_cnt to bottom of frame
authorAbhishek Dubey <adubey@linux.ibm.com>
Sat, 24 Jan 2026 07:52:18 +0000 (13:22 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 29 Jan 2026 03:36:00 +0000 (09:06 +0530)
commit15513beeb673765c05cdd8e526ccee33906375cb
treeac55affb7d23a2a46a5badd22007b07350b05943
parent815a8d2feb5615ae7f0b5befd206af0b0160614c
powerpc64/bpf: Moving tail_call_cnt to bottom of frame

To support tailcalls in subprogs, tail_call_cnt needs to be on the BPF
trampoline stack frame. In a regular BPF program or subprog stack
frame, the position of tail_call_cnt is after the NVR save area
(BPF_PPC_STACK_SAVE). To avoid complex logic in deducing offset for
tail_call_cnt, it has to be kept at the same offset on the trampoline
frame as well. But doing that wastes nearly all of BPF_PPC_STACK_SAVE
bytes on the BPF trampoline stack frame as the NVR save area is not
the same for BPF trampoline and regular BPF programs. Address this by
moving tail_call_cnt to the bottom of the frame.

This change avoids the need to account for BPF_PPC_STACK_SAVE bytes
in the BPF trampoline stack frame when support for tailcalls in BPF
subprogs is added later. Also, this change makes offset calculation
of tail_call_cnt field simpler all across.

Signed-off-by: Abhishek Dubey <adubey@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260124075223.6033-2-adubey@linux.ibm.com
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp.c
arch/powerpc/net/bpf_jit_comp64.c