Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: selftests: Do not use generated kfunc prototypes for arena progs

When selftests are built with a new enough clang, the arena selftests
opt-in to use LLVM address_space attribute annotations for arena
pointers.

These annotations are not emitted by kfunc prototype generation. This
causes compilation errors when clang sees conflicting prototypes.

Fix by opting arena selftests out of using generated kfunc prototypes.

Fixes: 770abbb5a25a ("bpftool: Support dumping kfunc prototypes from BTF")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202406131810.c1B8hTm8-lkp@intel.com/
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/fc59a617439ceea9ad8dfbb4786843c2169496ae.1718295425.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Daniel Xu and committed by
Alexei Starovoitov
6a826014 78746f93

+4
+1
tools/testing/selftests/bpf/progs/arena_htab.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3 + #define BPF_NO_KFUNC_PROTOTYPES 3 4 #include <vmlinux.h> 4 5 #include <bpf/bpf_helpers.h> 5 6 #include <bpf/bpf_tracing.h>
+1
tools/testing/selftests/bpf/progs/arena_list.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3 + #define BPF_NO_KFUNC_PROTOTYPES 3 4 #include <vmlinux.h> 4 5 #include <bpf/bpf_helpers.h> 5 6 #include <bpf/bpf_tracing.h>
+1
tools/testing/selftests/bpf/progs/verifier_arena.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3 3 4 + #define BPF_NO_KFUNC_PROTOTYPES 4 5 #include <vmlinux.h> 5 6 #include <bpf/bpf_helpers.h> 6 7 #include <bpf/bpf_tracing.h>
+1
tools/testing/selftests/bpf/progs/verifier_arena_large.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3 3 4 + #define BPF_NO_KFUNC_PROTOTYPES 4 5 #include <vmlinux.h> 5 6 #include <bpf/bpf_helpers.h> 6 7 #include <bpf/bpf_tracing.h>