Skip to contentSkip to conversation

kbuild, bpf: enable --btf_features=attributes

PATCH Applied Ihor Solodrai 3 participants 3 messages Apr 14, 2025 – Apr 15, 2025

Subsystems (2)
lore
Share & tools
lore

Ihor Solodrai

author reviewer
#0 lore raw

PATCH 1/1 kbuild, bpf: enable --btf_features=attributes

pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging bpf_arena_alloc_pages and bpf_arena_free_pages BPF kfuncs [1][2].

Enable it for the kernel build.

[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/

---
 scripts/Makefile.btf | 2 ++
 1 file changed, 2 insertions(+)
scripts/Makefile.btf +2 -0
index fbaaec2187e5..db76335dd917 100644
@@ -23,6 +23,8 @@ else
 # Switch to using --btf_features for v1.26 and later.
 pahole-flags-$(call test-ge, $(pahole-ver), 126)  = -j$(JOBS) --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
 
+pahole-flags-$(call test-ge, $(pahole-ver), 130) += --btf_features=attributes
+
 ifneq ($(KBUILD_EXTMOD),)
 module-pahole-flags-$(call test-ge, $(pahole-ver), 128) += --btf_features=distilled_base
 endif
Signature · 1 line
2.49.0
maintainer Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ihor Solodrai

pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging bpf_arena_alloc_pages and bpf_arena_free_pages BPF kfuncs [1][2].

Enable it for the kernel build.

[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/

---

With this patch and a new pahole I see the following text in vmlinux.h:

  ...
  extern void __attribute__((address_space(1))) *bpf_arena_alloc_pages(void *p__map, void __attribute__((address_space(1))) *addr__ign, u32 page_cnt, int node_id, u64 flags) __weak __ksym;
  extern void bpf_arena_free_pages(void *p__map, void __attribute__((address_space(1))) *ptr__ign, u32 page_cnt) __weak __ksym;
  ...

test_progs are compiling and passing w/o issues.

[...]

#2 lore raw
In reply to Ihor Solodrai
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Quoted 10 lines · On Mon, 14 Apr 2025 11:59:18 -0700 you wrote:

pahole v1.30 has a BTF encoding feature for arbitrary attributes, used in particular for tagging bpf_arena_alloc_pages and bpf_arena_free_pages BPF kfuncs [1][2].

Enable it for the kernel build.

[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/[email protected]/

[...]

Here is the summary with links:
- [bpf-next] kbuild, bpf: enable --btf_features=attributes

    https://git.kernel.org/bpf/bpf-next/c/21cb33c7e065

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html