BPF List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: 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,
	Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH dwarves] dwarf_loader: Limit parameter location analysis to x86_64 and arm64
Date: Sun, 4 Oct 2026 07:50:00 +0100	[thread overview]
Message-ID: <84593b64-4002-4557-9d4d-e9f7d44acdd5@oracle.com> (raw)
In-Reply-To: <b845d224-fc7e-4789-b7cb-8decb3c9520d@oracle.com>

On 03/10/2026 11:13, Alan Maguire wrote:
> On 03/10/2026 09:43, Yonghong Song wrote:
>> Since commit e96290426e18 ("dwarf_loader: Analyze per-parameter
>> information for true signatures"), clang-built kernels on arm, powerpc
>> and riscv lose most of their functions from BTF, and resolve_btfids
>> emits thousands of warnings like:
>>
>>   WARN: resolve_btfids: no BTF func for kfunc bpf_xdp_get_xfrm_state in xfrm_state_kfunc_set
>>   WARN: resolve_btfids: unresolved symbol bpf_xdp_get_xfrm_state
>>
>> For clang functions whose signature did not change, the new
>> function__match_clang_parameter_locations() checks that each parameter
>> lives in its expected ABI argument register. arch__nr_register_params()
>> returns a non-zero count for powerpc, riscv, mips, arc and sparc, but
>> arch__set_register_params() only fills in the register map for s390,
>> x86_64, arm and arm64, leaving the other entries at -1. Every parameter
>> held in a register then fails the match, the function is marked
>> unexpected_reg and is skipped. The previous per-parameter check in
>> parameter__new() ignored unknown expected registers, so this is a
>> regression. 32-bit arm has a register map, but it does not match
>> AAPCS32 (only r0-r3 carry arguments, and 64-bit arguments need an
>> even/odd register pair).
>>
>> The parameter location matching and true signature reconstruction have
>> only been validated on x86_64 and arm64. Add cu->param_loc_supported and
>> set it only for those two architectures. On other architectures, skip
>> the clang register matching and do not do true signature analysis in
>> the DWARF loader or the BTF encoder, keeping the basic optimized-out
>> parameter detection that existed before.
>>
>> With a riscv64 or powerpc64le object built by clang 22, functions such
>> as int f(int a, int b) are now encoded again instead of being skipped
>> with "unexpected register usage for parameter". x86_64 and arm64 output
>> is unchanged, with and without true_signature.
>>
>> Fixes: e96290426e180703 ("dwarf_loader: Analyze per-parameter information for true signatures")
>> Reported-by: Nathan Chancellor <nathan@kernel.org>
>> Tested-by: Nathan Chancellor <nathan@kernel.org> # build
>> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> 
> Thanks; fix looks low-risk, high-value to me so I will apply shortly unless
> anyone objects..
>

applied, thanks.


      reply	other threads:[~2026-10-04  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  8:43 [PATCH dwarves] dwarf_loader: Limit parameter location analysis to x86_64 and arm64 Yonghong Song
2026-10-03 10:13 ` Alan Maguire
2026-10-04  6:50   ` Alan Maguire [this message]

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=84593b64-4002-4557-9d4d-e9f7d44acdd5@oracle.com \
    --to=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=nathan@kernel.org \
    --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