Re: [PATCH bpf-next v4 15/18] bpf,x86: Implement JIT support for stack arguments

Alexei Starovoitov
2026-04-14T17:51:26Z

On Tue, Apr 14, 2026 at 9:46 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>
>
> I think we should do
>
> for foo1 (from llvm)
> a6: off -8
> a7: off -16
> a8: off -24
> for foo2 (from llvm)
> a6: off -8
> a7: off -16
> a8: off -24
> a9: off -32
> a10: off -40
>
> For x86,
> off -8 will do move for r9
> and then we can do
> foo1 (4 stack slots):
> <unknown>
> <unknown>
> off -24
> off -16
> foo2 (4 stack slots):
> off -40
> off -32
> off -24
> off -16

I don't see how this can work. You still need to know per-callsite max
to be able to flip the order and not only max, but which STX belong
to that callsite.
Also compiler may share single STX insn for different callsites.

So yeah, it's a real issue and it needs more thinking.
Back to explicit r11 adjustment, I guess.