Skip to content

Commit

Permalink
bpf, x64: Propagate tailcall info only for subprogs
Browse files Browse the repository at this point in the history
In x64 JIT, propagate tailcall info only for subprogs, not for helpers
or kfuncs.

Signed-off-by: Leon Hwang <[email protected]>
  • Loading branch information
Asphaltt authored and Kernel Patches Daemon committed Nov 1, 2024
1 parent a37c487 commit 4aa39f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,10 +2124,11 @@ st: if (is_imm8(insn->off))

/* call */
case BPF_JMP | BPF_CALL: {
bool pseudo_call = src_reg == BPF_PSEUDO_CALL;
u8 *ip = image + addrs[i - 1];

func = (u8 *) __bpf_call_base + imm32;
if (tail_call_reachable) {
if (pseudo_call && tail_call_reachable) {
LOAD_TAIL_CALL_CNT_PTR(bpf_prog->aux->stack_depth);
ip += 7;
}
Expand Down

0 comments on commit 4aa39f9

Please sign in to comment.