mbox series

[v2,bpf-next,0/6] bpf: resilient split BTF followups

Message ID 20240620091733.1967885-1-alan.maguire@oracle.com (mailing list archive)
Headers show
Series bpf: resilient split BTF followups | expand

Message

Alan Maguire June 20, 2024, 9:17 a.m. UTC
Follow-up to resilient split BTF series [1],

- cleaning up libbpf relocation code (patch 1);
- adding 'struct module' support for base BTF data (patch 2);
- splitting out field iteration code into separate file (patch 3);
- sharing libbpf relocation code with the kernel (patch 4);
- adding a kbuild --btf_features flag to generate distilled base
  BTF in the module-specific case where KBUILD_EXTMOD is true
  (patch 5); and
- adding test coverage for module-based kfunc dtor (patch 6)

Generation of distilled base BTF for modules requires the pahole patch
at [2], but without it we just won't get distilled base BTF (and thus BTF
relocation on module load) for bpf_testmod.ko.

Changes since v1 [3]:

- fixed line lengths and made comparison an explicit == 0 (Andrii, patch 1)
- moved btf_iter.c changes to separate patch (Andrii, patch 3)
- grouped common targets in kernel/bpf/Makefile (Andrii, patch 4)
- updated bpf_testmod ctx alloc to use GFP_ATOMIC, and updated dtor
  selftest to use map-based dtor cleanup (Eduard, patch 6)

[1] https://lore.kernel.org/bpf/20240613095014.357981-1-alan.maguire@oracle.com/
[2] https://lore.kernel.org/bpf/20240517102714.4072080-1-alan.maguire@oracle.com/
[3] https://lore.kernel.org/bpf/20240618162449.809994-1-alan.maguire@oracle.com/

Alan Maguire (6):
  libbpf: BTF relocation followup fixing naming, loop logic
  module, bpf: store BTF base pointer in struct module
  libbpf: split field iter code into its own file kernel
  libbpf,bpf: share BTF relocate-related code with kernel
  kbuild,bpf: add module-specific pahole flags for distilled base BTF
  selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod

 include/linux/btf.h                           |  64 +++++++
 include/linux/module.h                        |   2 +
 kernel/bpf/Makefile                           |   8 +-
 kernel/bpf/btf.c                              | 176 ++++++++++++-----
 kernel/module/main.c                          |   5 +-
 scripts/Makefile.btf                          |   5 +
 scripts/Makefile.modfinal                     |   2 +-
 tools/lib/bpf/Build                           |   2 +-
 tools/lib/bpf/btf.c                           | 162 ----------------
 tools/lib/bpf/btf_iter.c                      | 177 ++++++++++++++++++
 tools/lib/bpf/btf_relocate.c                  |  95 ++++++----
 .../selftests/bpf/bpf_testmod/bpf_testmod.c   |  46 +++++
 .../bpf/bpf_testmod/bpf_testmod_kfunc.h       |   9 +
 .../selftests/bpf/prog_tests/kfunc_call.c     |   1 +
 .../selftests/bpf/progs/kfunc_call_test.c     |  37 ++++
 15 files changed, 532 insertions(+), 259 deletions(-)
 create mode 100644 tools/lib/bpf/btf_iter.c

Comments

patchwork-bot+netdevbpf@kernel.org June 21, 2024, 10:10 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Thu, 20 Jun 2024 10:17:27 +0100 you wrote:
> Follow-up to resilient split BTF series [1],
> 
> - cleaning up libbpf relocation code (patch 1);
> - adding 'struct module' support for base BTF data (patch 2);
> - splitting out field iteration code into separate file (patch 3);
> - sharing libbpf relocation code with the kernel (patch 4);
> - adding a kbuild --btf_features flag to generate distilled base
>   BTF in the module-specific case where KBUILD_EXTMOD is true
>   (patch 5); and
> - adding test coverage for module-based kfunc dtor (patch 6)
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/6] libbpf: BTF relocation followup fixing naming, loop logic
    https://git.kernel.org/bpf/bpf-next/c/d1cf840854bb
  - [v2,bpf-next,2/6] module, bpf: store BTF base pointer in struct module
    https://git.kernel.org/bpf/bpf-next/c/d4e48e3dd450
  - [v2,bpf-next,3/6] libbpf: split field iter code into its own file kernel
    https://git.kernel.org/bpf/bpf-next/c/e7ac331b3055
  - [v2,bpf-next,4/6] libbpf,bpf: share BTF relocate-related code with kernel
    https://git.kernel.org/bpf/bpf-next/c/8646db238997
  - [v2,bpf-next,5/6] kbuild,bpf: add module-specific pahole flags for distilled base BTF
    https://git.kernel.org/bpf/bpf-next/c/46fb0b62ea29
  - [v2,bpf-next,6/6] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod
    https://git.kernel.org/bpf/bpf-next/c/47a8cf0c5b3f

You are awesome, thank you!