From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Alan Maguire" <alan.maguire@oracle.com>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Arnaldo Carvalho de Melo" <arnaldo.melo@gmail.com>,
<dwarves@vger.kernel.org>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
"Andrii Nakryiko" <andrii@kernel.org>, <bpf@vger.kernel.org>,
<kernel-team@fb.com>
Subject: Re: [PATCH dwarves v2 0/3] pahole: Fix arm64 argument register allocation
Date: Thu, 24 Sep 2026 16:20:08 +0000 [thread overview]
Message-ID: <DLNOMA3RI740.18YZJ9G0HDKDQ@gmail.com> (raw)
In-Reply-To: <09dbfeea-a4d1-4b7a-b92e-bcf8c4cdabb4@oracle.com>
On Thu Sep 24, 2026 at 4:15 PM UTC, Alan Maguire wrote:
> On 17/09/2026 17:40, Yonghong Song wrote:
>>
>> The arm64 ABI starts an argument twice the register size on an even-numbered
>> argument register, leaving a hole when the next free register is an odd one:
>>
>> u64 f(u64 a, __int128 v, u64 b);
>>
>> passes a in x0, v in x2:x3 -- skipping x1 -- and b in x4. pahole did not
>> model the hole, so b looked like it was in an unexpected register and the
>> whole function was dropped from BTF. Patch 1 skips the register the ABI
>> leaves behind, patch 3 adds a test for it. Only arm64 has this rule; the
>> other architectures are unaffected.
>>
>> Patch 2 is a small follow-up. Floating point and vector arguments are
>> allocated from a register bank of their own -- v0-v7 on arm64, xmm0-xmm7 on
>> x86-64 -- so a wide one never occupies a general purpose register pair and
>> must not trigger the even-register rule either. It does not change the BTF
>> emitted today, because such an argument still advances the general purpose
>> register index by its own size, so it comes with no test of its own; it
>> keeps the alignment rule scoped to the bank it applies to.
>>
>
> one small issue here; we record alignment for structs from DW_AT_align
> in associated tags; we should ensure that we utilize that alignment
> where available. However it's a bit broken in that we don't appear
> to record alignment for typedefs, just structs.
>
> I think we can tackle that with a followup though; unless anyone objects I'll
> land these patches later today.
Pls go ahead.
Also pls land LOC* things too, so you can post the rest of LOC* kernel bits.
So that everything lands and ready for the merge window in a couple weeks.
People will be traveling soon, so the sooner the better.
next prev parent reply other threads:[~2026-09-24 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 16:40 [PATCH dwarves v2 0/3] pahole: Fix arm64 argument register allocation Yonghong Song
2026-09-17 16:40 ` [PATCH 1/3] dwarf_loader: Skip the argument register the arm64 ABI leaves as a hole Yonghong Song
2026-09-17 16:40 ` [PATCH 2/3] dwarf_loader: Do not align the argument register index for FP arguments Yonghong Song
2026-09-17 16:40 ` [PATCH 3/3] tests: tests: Add test for 16-byte aligned arguments on arm64 Yonghong Song
2026-09-24 16:15 ` [PATCH dwarves v2 0/3] pahole: Fix arm64 argument register allocation Alan Maguire
2026-09-24 16:20 ` Alexei Starovoitov [this message]
2026-09-25 6:59 ` Alan Maguire
2026-09-25 7:03 ` Alan Maguire
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=DLNOMA3RI740.18YZJ9G0HDKDQ@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=kernel-team@fb.com \
--cc=yonghong.song@linux.dev \
/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