Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc64/bpf: Avoid tailcall restore from trampoline

Back propagation of tailcall count is no longer needed for
powerpc64 due to use of reference, which updates the tailcall
count in the tail_call_info field in the frame of the main
program only.

Back propagation is still required for 32-bit powerpc.

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-4-adubey@linux.ibm.com

authored by

Abhishek Dubey and committed by
Madhavan Srinivasan
88cb7f40 2ed2d8f6

+5 -8
+5 -8
arch/powerpc/net/bpf_jit_comp.c
··· 676 676 static void bpf_trampoline_restore_tail_call_cnt(u32 *image, struct codegen_context *ctx, 677 677 int func_frame_offset, int r4_off) 678 678 { 679 - if (IS_ENABLED(CONFIG_PPC64)) { 680 - /* See bpf_jit_stack_tailcallcnt() */ 681 - int tailcallcnt_offset = BPF_PPC_TAILCALL; 682 - 683 - EMIT(PPC_RAW_LL(_R3, _R1, -tailcallcnt_offset)); 684 - EMIT(PPC_RAW_STL(_R3, _R1, func_frame_offset - tailcallcnt_offset)); 685 - } else { 686 - /* See bpf_jit_stack_offsetof() and BPF_PPC_TC */ 679 + if (IS_ENABLED(CONFIG_PPC32)) { 680 + /* 681 + * Restore tailcall for 32-bit powerpc 682 + * See bpf_jit_stack_offsetof() and BPF_PPC_TC 683 + */ 687 684 EMIT(PPC_RAW_STL(_R4, _R1, r4_off)); 688 685 } 689 686 }