From: Alan Maguire <alan.maguire@oracle.com>
To: tony.ambardar@gmail.com
Cc: alan.maguire@oracle.com, andrii@kernel.org, arnd@arndb.de,
ast@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net,
eddyz87@gmail.com, haoluo@google.com, john.fastabend@gmail.com,
jolsa@kernel.org, kpsingh@kernel.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
lmb@isovalent.com, martin.lau@linux.dev, mykolal@fb.com,
sdf@fomichev.me, shuah@kernel.org, song@kernel.org,
yonghong.song@linux.dev
Subject: vmlinux BTF as a module (was Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux)
Date: Wed, 21 May 2025 16:00:19 +0100 [thread overview]
Message-ID: <ace72324-6395-4e9b-8406-7d99d57018dd@oracle.com> (raw)
In-Reply-To: <aC0OpCZCEziDXhwh@kodidev-ubuntu>
> Hi Alan,
>
> Thanks for taking a look at this. I've been following your related effort
> to allow /sys/kernel/btf/vmlinux as a module in support of small systems
> with kernel-size constraints, and wondered how this series might affect
> that work? Such support would be well-received in the embedded space when
> it happens, so am keen to understand.
>
> Thanks,
> Tony
hi Tony
I had something nearly working a few months back but there are a bunch
of complications that made it a bit trickier than I'd first anticipated.
One challenge for example is that we want /sys/kernel/btf to behave just
as it would if vmlinux BTF was not a module. My original hope was to
just have the vmlinux BTF module forceload early, but the request module
approach won't work since the vmlinux_btf.ko module would have to be
part of the initrd image. A question for you on this - I presume that's
what you want to avoid, right? So I'm assuming that we need to extract
the .BTF section out of the vmlinu[xz] binary and out of initrd into a
later-loading vmlinux_btf.ko module for small-footprint systems. Is that
correct?
The reason I ask is having a later-loading vmlinux_btf.ko is a bit of a
pain since we need to walk the set of kernel modules and load their BTF,
relocate it and do kfunc registration. If we can simplify things via a
shared module dependency on vmlinux_btf.ko that would be great, but I'd
like to better understand the constraints from the small system
perspective first. Thanks!
Alan
next prev parent reply other threads:[~2025-05-21 15:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-10 12:34 [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux Lorenz Bauer
2025-05-10 12:34 ` [PATCH bpf-next v4 1/3] btf: allow mmap of vmlinux btf Lorenz Bauer
2025-05-10 12:34 ` [PATCH bpf-next v4 2/3] selftests: bpf: add a test for mmapable vmlinux BTF Lorenz Bauer
2025-05-10 12:34 ` [PATCH bpf-next v4 3/3] libbpf: Use mmap to parse vmlinux BTF from sysfs Lorenz Bauer
2025-05-12 22:33 ` Andrii Nakryiko
2025-05-15 7:51 ` [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux Alan Maguire
2025-05-20 23:22 ` Tony Ambardar
2025-05-21 15:00 ` Alan Maguire [this message]
2025-05-23 1:04 ` vmlinux BTF as a module (was Re: [PATCH bpf-next v4 0/3] Allow mmap of /sys/kernel/btf/vmlinux) Alexei Starovoitov
2025-05-23 17:27 ` Andrii Nakryiko
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=ace72324-6395-4e9b-8406-7d99d57018dd@oracle.com \
--to=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lmb@isovalent.com \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tony.ambardar@gmail.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 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.