[PATCH bpf-next v3 0/9] Add arena argument support to kfuncs and struct_ops
Kumar Kartikeya Dwivedi <[email protected]> Mon, 3 Aug 2026 14:51:01 +0200
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
This is a continuation of patches in [0], with mostly minor changes and reordering. The motivation is covered in that link. A major change is moving to two tags (__arena and __arena_nullable) and moving the changes to JIT to emit more optimized sequences. Please see commit logs for details. [0]: https://lore.kernel.org/bpf/[email protected] Changelog: ---------- v2 -> v3 v2: https://lore.kernel.org/bpf/[email protected] * Rebase onto current bpf-next to resolve conflicts. v1 -> v2 v1: https://lore.kernel.org/bpf/[email protected] * Fix documentation to only mention x86 for now. (Sashiko) * Move arg bitmap from insn_aux_data to kfunc descriptor. (Eduard) Tejun Heo (9): bpf: Support __arena and __arena_nullable kfunc argument suffixes bpf: Support __arena and __arena_nullable on struct_ops arguments bpf, x86: JIT __arena kfunc argument rebasing bpf, x86: Convert struct_ops arena arguments in the trampoline selftests/bpf: Add kfunc __arena and __arena_nullable argument tests selftests/bpf: Add JIT-sequence tests for __arena kfunc arguments selftests/bpf: Add struct_ops __arena and __arena_nullable argument tests bpf, x86: Fix stack-passed arguments for indirect trampolines selftests/bpf: Test stack-passed struct_ops arena arguments Documentation/bpf/kfuncs.rst | 39 +++ arch/x86/net/bpf_jit_comp.c | 129 ++++++++- include/linux/bpf.h | 25 ++ include/linux/filter.h | 1 + kernel/bpf/bpf_struct_ops.c | 34 ++- kernel/bpf/btf.c | 28 +- kernel/bpf/core.c | 5 + kernel/bpf/trampoline.c | 64 +++++ kernel/bpf/verifier.c | 63 ++++- .../selftests/bpf/prog_tests/arena_kfunc.c | 15 + .../bpf/prog_tests/arena_kfunc_jit.c | 13 + .../bpf/prog_tests/test_struct_ops_arena.c | 74 +++++ .../testing/selftests/bpf/progs/arena_kfunc.c | 260 ++++++++++++++++++ .../selftests/bpf/progs/arena_kfunc_jit.c | 96 +++++++ .../selftests/bpf/progs/struct_ops_arena.c | 115 ++++++++ .../bpf/progs/struct_ops_arena_fail.c | 20 ++ .../selftests/bpf/test_kmods/bpf_testmod.c | 95 +++++++ .../selftests/bpf/test_kmods/bpf_testmod.h | 6 + .../bpf/test_kmods/bpf_testmod_kfunc.h | 13 + 19 files changed, 1062 insertions(+), 33 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_kfunc.c create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_kfunc_jit.c create mode 100644 tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c create mode 100644 tools/testing/selftests/bpf/progs/arena_kfunc.c create mode 100644 tools/testing/selftests/bpf/progs/arena_kfunc_jit.c create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_arena.c create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_arena_fail.c base-commit: 60781269e26c786de2bb93fb1e697a5c32ccee48 -- 2.53.0