From: Hari Bathini <hbathini@linux.ibm.com>
To: adubey <adubey@linux.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
bpf@vger.kernel.org, Madhavan Srinivasan <maddy@linux.ibm.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Saket Kumar Bhaskar <skb99@linux.ibm.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Subject: Re: [PATCH v2 3/5] powerpc64/bpf: use consistent tailcall offset in trampoline
Date: Tue, 3 Mar 2026 19:13:13 +0530 [thread overview]
Message-ID: <30d026c1-5d0d-4679-95e3-cd39b670d353@linux.ibm.com> (raw)
In-Reply-To: <2f33ecbbe8272184111c5406d167b6b0@linux.ibm.com>
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
next prev parent reply other threads:[~2026-03-03 13:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 6:39 [PATCH v2 0/5] powerpc64/bpf: various fixes Hari Bathini
2026-02-20 6:39 ` [PATCH v2 1/5] powerpc64/bpf: do not increment tailcall count when prog is NULL Hari Bathini
2026-02-21 3:40 ` Venkat Rao Bagalkote
2026-02-20 6:39 ` [PATCH v2 2/5] powerpc64/bpf: fix the address returned by bpf_get_func_ip Hari Bathini
2026-02-21 3:41 ` Venkat Rao Bagalkote
2026-02-22 12:21 ` adubey
2026-02-20 6:39 ` [PATCH v2 3/5] powerpc64/bpf: use consistent tailcall offset in trampoline Hari Bathini
2026-02-22 13:07 ` adubey
2026-03-03 13:43 ` Hari Bathini [this message]
2026-02-20 6:39 ` [PATCH v2 4/5] powerpc64/bpf: remove BPF redzone protection in trampoline stack Hari Bathini
2026-02-21 3:43 ` Venkat Rao Bagalkote
2026-02-20 6:39 ` [PATCH v2 5/5] powerpc64/bpf: fix handling of BPF stack in exception callback Hari Bathini
2026-02-23 9:03 ` adubey
2026-03-03 13:46 ` Hari Bathini
2026-02-24 12:28 ` adubey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30d026c1-5d0d-4679-95e3-cd39b670d353@linux.ibm.com \
--to=hbathini@linux.ibm.com \
--cc=adubey@linux.ibm.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=skb99@linux.ibm.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox