Skip to content

Commit 88cb7f4

Browse files
Abhishek Dubeymaddy-kerneldev
authored andcommitted
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
1 parent 2ed2d8f commit 88cb7f4

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

arch/powerpc/net/bpf_jit_comp.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -676,14 +676,11 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte
676676
static void bpf_trampoline_restore_tail_call_cnt(u32 *image, struct codegen_context *ctx,
677677
int func_frame_offset, int r4_off)
678678
{
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+
*/
687684
EMIT(PPC_RAW_STL(_R4, _R1, r4_off));
688685
}
689686
}

0 commit comments

Comments
 (0)