BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/5] bpf: resilient split BTF followups
@ 2024-06-18 16:24 Alan Maguire
  2024-06-18 16:24 ` [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Maguire @ 2024-06-18 16:24 UTC (permalink / raw)
  To: andrii, eddyz87
  Cc: acme, ast, daniel, jolsa, martin.lau, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, mcgrof, masahiroy, nathan,
	mykolal, thinker.li, bentiss, tanggeliang, bpf, Alan Maguire

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);
- sharing libbpf relocation code with the kernel (patch 3);
- adding a kbuild --btf_features flag to generate distilled base
  BTF in the module-specific case where KBUILD_EXTMOD is true
  (patch 4); and
- adding test coverage for module-based kfunc dtor (patch 5)

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.

[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/

Alan Maguire (5):
  libbpf: BTF relocation followup fixing naming, loop logic
  module, bpf: store BTF base pointer in struct module
  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                           |  10 +-
 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                  |  97 ++++++----
 .../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     |  14 ++
 15 files changed, 513 insertions(+), 259 deletions(-)
 create mode 100644 tools/lib/bpf/btf_iter.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-20 11:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240618160454.801527-1-alan.maguire@oracle.com>
     [not found] ` <20240618160454.801527-6-alan.maguire@oracle.com>
     [not found]   ` <4321b99db5b362e278b1f37d6bd9b9a43d859d63.camel@gmail.com>
     [not found]     ` <76509fc5411e35a4820c333abca155b3fa4e5b84.camel@gmail.com>
2024-06-19 16:45       ` [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire
2024-06-19 16:54         ` Eduard Zingerman
2024-06-19 17:42           ` Alan Maguire
2024-06-19 20:12             ` Eduard Zingerman
2024-06-20  9:17               ` Alan Maguire
2024-06-20 11:02                 ` Eduard Zingerman
2024-06-18 16:24 [PATCH bpf-next 0/5] bpf: resilient split BTF followups Alan Maguire
2024-06-18 16:24 ` [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox