From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
daniel@iogearbox.net, kernel-team@fb.com,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jessica Yu <jeyu@kernel.org>,
linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [RFC PATCH bpf-next 4/5] bpf: load and verify kernel module BTFs
Date: Thu, 5 Nov 2020 17:46:16 +0100 [thread overview]
Message-ID: <20201105164616.GA1201462@kroah.com> (raw)
In-Reply-To: <20201105083925.68433e51@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Thu, Nov 05, 2020 at 08:39:25AM -0800, Jakub Kicinski wrote:
> On Wed, 4 Nov 2020 20:51:39 -0800 Andrii Nakryiko wrote:
> > Add kernel module listener that will load/validate and unload module BTF.
> > Module BTFs gets ID generated for them, which makes it possible to iterate
> > them with existing BTF iteration API. They are given their respective module's
> > names, which will get reported through GET_OBJ_INFO API. They are also marked
> > as in-kernel BTFs for tooling to distinguish them from user-provided BTFs.
> >
> > Also, similarly to vmlinux BTF, kernel module BTFs are exposed through
> > sysfs as /sys/kernel/btf/<module-name>. This is convenient for user-space
> > tools to inspect module BTF contents and dump their types with existing tools:
>
> Is there any precedent for creating per-module files under a new
> sysfs directory structure? My intuition would be that these files
> belong under /sys/module/
Ick, why? What's wrong with them under btf? The module core code
"owns" the /sys/modules/ tree. If you want others to mess with that, it
will get tricky.
> Also the CC list on these patches is quite narrow. You should have
> at least CCed the module maintainer. Adding some folks now.
>
> > [vmuser@archvm bpf]$ ls -la /sys/kernel/btf
> > total 0
> > drwxr-xr-x 2 root root 0 Nov 4 19:46 .
> > drwxr-xr-x 13 root root 0 Nov 4 19:46 ..
> >
> > ...
> >
> > -r--r--r-- 1 root root 888 Nov 4 19:46 irqbypass
> > -r--r--r-- 1 root root 100225 Nov 4 19:46 kvm
> > -r--r--r-- 1 root root 35401 Nov 4 19:46 kvm_intel
> > -r--r--r-- 1 root root 120 Nov 4 19:46 pcspkr
> > -r--r--r-- 1 root root 399 Nov 4 19:46 serio_raw
> > -r--r--r-- 1 root root 4094095 Nov 4 19:46 vmlinux
> >
> > Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> > ---
> > include/linux/bpf.h | 2 +
> > include/linux/module.h | 4 +
> > kernel/bpf/btf.c | 193 +++++++++++++++++++++++++++++++++++++++++
> > kernel/bpf/sysfs_btf.c | 2 +-
> > kernel/module.c | 32 +++++++
> > 5 files changed, 232 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> > index 2fffd30e13ac..3cb89cd7177b 100644
> > --- a/include/linux/bpf.h
> > +++ b/include/linux/bpf.h
> > @@ -36,9 +36,11 @@ struct seq_operations;
> > struct bpf_iter_aux_info;
> > struct bpf_local_storage;
> > struct bpf_local_storage_map;
> > +struct kobject;
> >
> > extern struct idr btf_idr;
> > extern spinlock_t btf_idr_lock;
> > +extern struct kobject *btf_kobj;
I don't see any Documentation/ABI/ updates for the sysfs changes here,
did I miss it?
thanks,
greg k-h
next prev parent reply other threads:[~2020-11-05 16:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-05 4:51 [RFC PATCH bpf-next 0/5] Integrate kernel module BTF support Andrii Nakryiko
2020-11-05 4:51 ` [RFC PATCH bpf-next 1/5] bpf: add in-kernel split " Andrii Nakryiko
2020-11-05 4:51 ` [RFC PATCH bpf-next 2/5] bpf: assign ID to vmlinux BTF and return extra info for BTF in GET_OBJ_INFO Andrii Nakryiko
2020-11-06 3:19 ` Alexei Starovoitov
2020-11-06 3:43 ` Andrii Nakryiko
2020-11-05 4:51 ` [RFC PATCH bpf-next 3/5] kbuild: Add CONFIG_DEBUG_INFO_BTF_MODULES option or module BTFs Andrii Nakryiko
2020-11-06 3:13 ` Alexei Starovoitov
2020-11-06 3:48 ` Andrii Nakryiko
2020-11-06 3:50 ` Alexei Starovoitov
2020-11-05 4:51 ` [RFC PATCH bpf-next 4/5] bpf: load and verify kernel " Andrii Nakryiko
2020-11-05 16:39 ` Jakub Kicinski
2020-11-05 16:46 ` Greg Kroah-Hartman [this message]
2020-11-05 16:58 ` Jakub Kicinski
2020-11-05 19:01 ` Andrii Nakryiko
2020-11-05 4:51 ` [RFC PATCH bpf-next 5/5] tools/bpftool: add support for in-kernel and named BTF in `btf show` 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=20201105164616.GA1201462@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=acme@redhat.com \
--cc=andrii@kernel.org \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jeyu@kernel.org \
--cc=kernel-team@fb.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rafael@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.