From: Tony Ambardar <tony.ambardar@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH dwarves v2] dwarf_loader: Fix skipped encoding of function BTF on 32-bit systems
Date: Thu, 8 May 2025 22:22:30 -0700 [thread overview]
Message-ID: <aB2RFj62fLMJPEKS@kodidev-ubuntu> (raw)
In-Reply-To: <e0754d8f-4ac0-4e03-88f3-2901d49ca4e6@oracle.com>
On Thu, May 08, 2025 at 02:24:57PM +0100, Alan Maguire wrote:
> On 02/05/2025 08:03, Tony Ambardar wrote:
> > I encountered an issue building BTF kernels for 32-bit armhf, where many
> > functions are missing in BTF data:
> >
> > LD vmlinux
> > BTFIDS vmlinux
> > WARN: resolve_btfids: unresolved symbol vfs_truncate
[...]
> >
> > Fixes: a53c58158b76 ("dwarf_loader: Mark functions that do not use expected registers for params")
> > Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
>
Hello Alan,
> I've tried this on x86_64 and the issue of missing functions has
> disappeared; I get the exact same number of functions encoded. From a
> pahole perspective
>
> Tested-by: Alan Maguire <alan.maguire@oracle.com>
>
Thanks for reviewing the latest update and putting it through its paces.
I was noticing many small changes in my own testing so this is welcome
confirmation.
> However as mentioned previously I think we need to think a bit about how
> libbpf for example might accommodate such representations, as the
> implict assumption for fentry in BPF_PROG() is that the function call
> register conventions apply. BPF_PROG2() handles the struct case, but not
> the 0-sized struct case, and in fact there are checks in btf.c that also
> need to be fixed to enable verification once we have 0-sized struct
> argument support.
>
> So in investigating this I've put together a short RFC series [1] that
> seems to do the job in
>
> 1. fixing up the BPF_PROG2() handling of 0-sized structs.
> 2. fixing the verification failures with 0-sized parameters, carving out
> an exception for 0-sized structs.
> 3. testing the 0-sized struct case to ensure we get the correct data by
> adding a function with a 0-sized struct parameter to bpf_testmod and
> adding a tracing_struct test to verify the subsequent arguments are correct.
>
OK, I'll try looking at this for 32-bit armhf since I'm in the middle of
that, and comment in the RFC thread.
> In terms of cadence, I would propose that if the BPF folks are happy
> with the approach, we land this patch in pahole, then after that try to
> land the BPF changes. Does that work from your side? Thanks!
>
> [1]
> https://lore.kernel.org/bpf/20250508132237.1817317-1-alan.maguire@oracle.com/
>
> Alan
>
Thanks,
Tony
[...]
next prev parent reply other threads:[~2025-05-09 5:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 8:33 [PATCH dwarves v1] dwarf_loader: Fix skipped encoding of function BTF on 32-bit systems Tony Ambardar
2025-04-10 12:20 ` Alan Maguire
2025-04-16 10:33 ` Tony Ambardar
2025-05-02 7:03 ` [PATCH dwarves v2] " Tony Ambardar
2025-05-08 9:38 ` Alexis Lothoré
2025-05-09 5:21 ` Tony Ambardar
2025-05-09 8:33 ` Alexis Lothoré
2025-05-12 8:41 ` Tony Ambardar
2025-05-08 13:24 ` Alan Maguire
2025-05-09 5:22 ` Tony Ambardar [this message]
2025-05-22 6:37 ` [PATCH dwarves v3] " Tony Ambardar
2025-06-24 16:14 ` Alan Maguire
2025-06-30 10:01 ` Alan Maguire
2025-06-30 13:51 ` Jiri Olsa
2025-06-30 17:32 ` 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=aB2RFj62fLMJPEKS@kodidev-ubuntu \
--to=tony.ambardar@gmail.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.