netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii@kernel.org>
To: <bpf@vger.kernel.org>, <netdev@vger.kernel.org>, <ast@fb.com>,
	<daniel@iogearbox.net>
Cc: <andrii@kernel.org>, <kernel-team@fb.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [RFC PATCH bpf-next 0/5] Integrate kernel module BTF support
Date: Wed, 4 Nov 2020 20:51:35 -0800	[thread overview]
Message-ID: <20201105045140.2589346-1-andrii@kernel.org> (raw)

This patch set adds BTF generation for kernel modules using a compact split BTF
approach. Respective patches have all the details.

New Kconfig CONFIG_DEBUG_INTO_BTF_MODULES is added, which is defaulted to y,
but is conditional on pahole v1.19 version, which is going to have a support
for --btf_base flag, providing ability to generate deduplicated split BTF.

This patch set implements in-kernel support for split BTF loading and
validation. It also extends GET_OBJ_INFO API for BTFs to return BTF's module
name and a flag whether BTF itself is in-kernel or user-provided. vmlinux BTF
is also exposed to user-space through the same BTF object iteration APIs.

Follow up patch set will utilize the fact that vmlinux and module BTFs now
have ID associated with them to provide ability to attach BPF fentry/fexit/etc
programs to functions defined in kernel modules.

bpftool is also extended to show module/vmlinux BTF's name.

This patch set is posted as an RFC because it depends on two not yet landed
set of patches:
  - libbpf split BTF support ([0]);
  - pahole's support for split BTF generation and deduplication ([1]).

  [0] https://patchwork.kernel.org/project/netdevbpf/list/?series=377859&state=*
  [1] https://lore.kernel.org/dwarves/20201105043936.2555804-1-andrii@kernel.org/T/#u

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>

Andrii Nakryiko (5):
  bpf: add in-kernel split BTF support
  bpf: assign ID to vmlinux BTF and return extra info for BTF in
    GET_OBJ_INFO
  kbuild: Add CONFIG_DEBUG_INFO_BTF_MODULES option or module BTFs
  bpf: load and verify kernel module BTFs
  tools/bpftool: add support for in-kernel and named BTF in `btf show`

 include/linux/bpf.h            |   2 +
 include/linux/module.h         |   4 +
 include/uapi/linux/bpf.h       |   3 +
 kernel/bpf/btf.c               | 411 ++++++++++++++++++++++++++++-----
 kernel/bpf/sysfs_btf.c         |   2 +-
 kernel/module.c                |  32 +++
 lib/Kconfig.debug              |  10 +
 scripts/Makefile.modfinal      |  20 +-
 tools/bpf/bpftool/btf.c        |  30 ++-
 tools/include/uapi/linux/bpf.h |   3 +
 10 files changed, 460 insertions(+), 57 deletions(-)

-- 
2.24.1


             reply	other threads:[~2020-11-05  4:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05  4:51 Andrii Nakryiko [this message]
2020-11-05  4:51 ` [RFC PATCH bpf-next 1/5] bpf: add in-kernel split BTF support 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
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=20201105045140.2589346-1-andrii@kernel.org \
    --to=andrii@kernel.org \
    --cc=acme@redhat.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).