Fixes for kfunc prototype generation
Subsystems (3)
cover Fixes for kfunc prototype generation
This patchset fixes new warnings and errors that kfunc prototype generation caused.
Daniel Xu (2):
bpf: Fix bpf_dynptr documentation comments
bpf: selftests: Do not use generated kfunc prototypes for arena progs
kernel/bpf/helpers.c | 4 ++-- tools/testing/selftests/bpf/progs/arena_htab.c | 1 + tools/testing/selftests/bpf/progs/arena_list.c | 1 + tools/testing/selftests/bpf/progs/verifier_arena.c | 1 + tools/testing/selftests/bpf/progs/verifier_arena_large.c | 1 + 5 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.44.0
PATCH 1/2 bpf: Fix bpf_dynptr documentation comments
The function argument names were changed but the doc comment was not. Fix htmldocs build warning by updating doc comments.
--- kernel/bpf/helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/bpf/helpers.c +2 -2
@@ -2433,7 +2433,7 @@ __bpf_kfunc struct task_struct *bpf_task_from_pid(s32 pid)/** * bpf_dynptr_slice() - Obtain a read-only pointer to the dynptr data. -* @ptr: The dynptr whose data slice to retrieve +* @p: The dynptr whose data slice to retrieve * @offset: Offset into the dynptr * @buffer__opt: User-provided buffer to copy contents into. May be NULL * @buffer__szk: Size (in bytes) of the buffer if present. This is the
@@ -2504,7 +2504,7 @@ __bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr *p, u32 offset,/** * bpf_dynptr_slice_rdwr() - Obtain a writable pointer to the dynptr data. -* @ptr: The dynptr whose data slice to retrieve +* @p: The dynptr whose data slice to retrieve * @offset: Offset into the dynptr * @buffer__opt: User-provided buffer to copy contents into. May be NULL * @buffer__szk: Size (in bytes) of the buffer if present. This is the
Signature · 1 line
2.44.0
PATCH 2/2 bpf: selftests: Do not use generated kfunc prototypes for arena progs
In reply to Daniel XuWhen 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.
--- tools/testing/selftests/bpf/progs/arena_htab.c | 1 + tools/testing/selftests/bpf/progs/arena_list.c | 1 + tools/testing/selftests/bpf/progs/verifier_arena.c | 1 + tools/testing/selftests/bpf/progs/verifier_arena_large.c | 1 + 4 files changed, 4 insertions(+)
tools/testing/selftests/bpf/progs/arena_htab.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ +#define BPF_NO_KFUNC_PROTOTYPES #include <vmlinux.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h>
tools/testing/selftests/bpf/progs/arena_list.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ +#define BPF_NO_KFUNC_PROTOTYPES #include <vmlinux.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h>
tools/testing/selftests/bpf/progs/verifier_arena.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ +#define BPF_NO_KFUNC_PROTOTYPES #include <vmlinux.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h>
tools/testing/selftests/bpf/progs/verifier_arena_large.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ +#define BPF_NO_KFUNC_PROTOTYPES #include <vmlinux.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h>
Signature · 1 line
2.44.0
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Thu, 13 Jun 2024 10:19:24 -0600 you wrote:
This patchset fixes new warnings and errors that kfunc prototype generation caused.
Daniel Xu (2):
bpf: Fixbpf_dynptrdocumentation comments
bpf: selftests: Do not use generated kfunc prototypes for arena progs[...]
Here is the summary with links:
- [bpf-next,1/2] bpf: Fix bpf_dynptr documentation comments
https://git.kernel.org/bpf/bpf-next/c/78746f93e903 - [bpf-next,2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs https://git.kernel.org/bpf/bpf-next/c/6a8260147745
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html