summaryrefslogtreecommitdiff
path: root/include/linux/debugobjects.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-06-02 04:42:34 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-06-02 04:42:34 +0300
commit51321158a3657302c5e2e7892b7a5662f78d757a (patch)
tree1dbd52aff1e72f07e0ac941296ad778bfc29ed1d /include/linux/debugobjects.h
parentb6aa0abf9fb92789598dbf0d1b8f30b8071badbe (diff)
parent9fd5bf96ac4be2ec784598c818f672422182042c (diff)
downloadlinux-51321158a3657302c5e2e7892b7a5662f78d757a.tar.xz
Merge branch 'minimize-annotations-for-arena-programs'
Emil Tsalapatis says: ==================== Minimize annotations for arena programs BPF programs must currently include code to address two limitations of function signatures that include arena types. First, arena arguments must be annotated with __arg_arena in the function signature in addition to __arena. Second, it is currently not allowed to return an arena pointer from a subprog, even though it is safe to do so. These limitations require extra annotations and typecasts respectively, and have proven sources of confusion to programmers. The patchset improves arena-related function signatures in two ways. First, it removes the need for __arg_arena in function signatures. Second, it allows subprogs to directly return arena pointers to their caller. To do this we add a new type tag to the existing __arena annotation. The annotation is currently an alias for __attribute__((address_space(1))), which is not discoverable from BTF alone and so cannot be used to determine whether a pointer variable is an arena pointer during verification. With the new type tag, we can determine whether either the arguments and or the return value of a function belong in an arena. We test the new code by modifying libarena to take advantage of these relaxed limitations. CHANGELOG ========= v2 -> v3 (https://lore.kernel.org/bpf/20260530002259.4505-1-emil@etsalapatis.com/) - Added Acks by Eduard - Complete the __arg_arena removal by removing them from htab (Alexei) - Add a test in verifier_arena_globals1.c to confirm the new __arena attribute works as expected in function argument and return types - Reject type tags on non-pointer types, currently only possible in handcrafted BTF (Eduard) - Undo inaccurate change on verifier comment (AI) - Fix error return value for invalid BTF return types during BTF parsing (Eduard) v1 -> v2 (lore.kernel.org/bpf/20260527071457.4598-1-emil@etsalapatis.com/) - Rebased to fix conflict - Removed the typedef foo * foo_t typedefs. Those were necessary to avoid annotating each instance of the type with __arena. The new version of the patch instead removes typedefs and uses __arena everywhere directly (see patch 4/5 for more details). - Reorganized the patchset to frontload all kernel-side changes and place the libarena changes at the end. ==================== Link: https://patch.msgid.link/20260602004120.17087-1-emil@etsalapatis.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions