On 22/02/26 6:37 pm, adubey wrote:
On 2026-02-20 12:09, Hari Bathini wrote:Ideally, the offset used to load the tail call info field and to find the pass by reference address for tail call field should be the same. But while setting up the tail call info in the trampoline, this was not followed. This can be misleading and can lead to unpredictable results if and when bpf_has_stack_frame() ends up returning true for trampoline frame. Since commit 15513beeb673 ("powerpc64/bpf: Moving tail_call_cnt to bottom of frame") and commit 2ed2d8f6fb38 ("powerpc64/bpf: Support tailcalls with subprogs") ensured tail call field is at the bottom of the stack frame for BPF programs as well as BPF trampoline, avoid relying on bpf_jit_stack_tailcallinfo_offset() and bpf_has_stack_frame() for trampoline frame and always calculate tail call field offset with reference to older frame.
It's good to add comment about padding field placed after tailcall_info in the trampoline stack layout. Visibly padding is following tailcall_info but tailcall_info is bottom-most field. Clear comment around this will be really helpful.
"Generated stack layout:" does capture that clearly. Don't find it relevant to explain it again in this context.. - Hari
