]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libbpf: add __arg_xxx macros for annotating global func args
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 15 Dec 2023 01:13:32 +0000 (17:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 20 Dec 2023 02:06:47 +0000 (18:06 -0800)
Add a set of __arg_xxx macros which can be used to augment BPF global
subprogs/functions with extra information for use by BPF verifier.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231215011334.2307144-9-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/bpf_helpers.h

index 77ceea575dc755ad6e46b47be01392baa4280311..2324cc42b0178feacc152ee8a976a77bc11e0225 100644 (file)
@@ -188,6 +188,9 @@ enum libbpf_tristate {
        !!sym;                                                                                  \
 })
 
+#define __arg_ctx __attribute__((btf_decl_tag("arg:ctx")))
+#define __arg_nonnull __attribute((btf_decl_tag("arg:nonnull")))
+
 #ifndef ___bpf_concat
 #define ___bpf_concat(a, b) a ## b
 #endif