Message ID | 20241028134041.94098-2-leon.hwang@linux.dev (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | bpf, x64: Introduce two tailcall enhancements | expand |
On 10/28/24 6:40 AM, Leon Hwang wrote: > In x64 JIT, propagate tailcall info only for subprogs, not for helpers > or kfuncs. > > Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Acked-by: Yonghong Song <yonghong.song@linux.dev>
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 06b080b61aa57..eb08cc6d66401 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -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; }
In x64 JIT, propagate tailcall info only for subprogs, not for helpers or kfuncs. Signed-off-by: Leon Hwang <leon.hwang@linux.dev> --- arch/x86/net/bpf_jit_comp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)