summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2026-10-03 16:08:23 +0200
committerKumar Kartikeya Dwivedi <memxor@gmail.com>2026-10-03 16:08:23 +0200
commitd82cbceca49252bb0cd695326af8206c734e2744 (patch)
tree33600070d66a68bb6de66128e8a2f533565f9c25 /include/linux/timerqueue.h
parent5ec398d9ec8fe13f8058af9a2e5f5e8f46e0a35a (diff)
parente86cb7315451e166f1392032d392f1736fa6853e (diff)
downloadlinux-next-d82cbceca49252bb0cd695326af8206c734e2744.tar.gz
linux-next-d82cbceca49252bb0cd695326af8206c734e2744.zip
Merge branch 'bpf-support-programs-compiled-by-rust-bpf'
Alexei Starovoitov says: ==================== bpf: Support programs compiled by rust-bpf From: Alexei Starovoitov <ast@kernel.org> Rust programs compiled by rust-bpf keep all memory in arena and access it through plain numbers, since there are no address spaces in Rust. core tags pointers in the low bit. BTF of such program has names like 'Option<alloc::collections::btree::map::BTreeMap<u32, u32>>'. Patches 1-2 Allow ALU on pointers with CAP_PERFMON. The result is a number. Patches 3-4 Treat load and store through a number as arena access in programs loaded with BPF_F_ARENA_SCALAR. Patches 5-11 Accept BTF of Rust programs in the kernel: names of types and functions that are not C identifiers, arguments of static functions without names, a variable in DATASEC that is smaller than its type. bpftool doesn't read past such variable. Patches 12-14 libbpf: Keep .data, .bss and .rodata in arena when the object has .arena.data section and load its programs with BPF_F_ARENA_SCALAR. Format strings of bpf_printk() go to .rodata.str, which stays a map. Patch 15 A program in Rust, built by upstream rustc, that shows why the data has to be in arena. No changes for unprivileged programs. Without the flag a number is not an address, whether the program has an arena or not. Arena access through a number is for x86 and arm64: other JITs have to say that they take BPF_REG_AX as the address, the flag is rejected with -EOPNOTSUPP there. arm64 is compile tested only. With the series the kernel loads BTF of scx_simple and scx_cosmos schedulers written in Rust, of the unwind and of the immediate-abort builds. The objects call bpf_alloc(), bpf_free(), bpf_arena_memcpy() and bpf_arena_memcmp(), which are not in the series, so they don't load yet. v1 -> v2: - Rebased. Added Acked-by from Alan. - Patch 6: the test is serial, since other tests set bpf_jit_harden and programs are not in kallsyms then. Use kallsyms_find(). - Patch 8: add comments and a test for vararg of a global function (Alan). - Patch 10: new. bpftool map dump and bpftool prog show read past a variable in DATASEC that is smaller than its type. - Patch 11: check bpftool map dump. - Patch 12: . fix overflow in the check of r_offset of a pointer in data. . __arena variables in an object without .maps section were placed over .data in the arena that libbpf creates. Fail the open. . pin_path and bpf_map__reuse_fd() of the arena were ignored when there are pointers in data. Fail the load. . don't create the arena when its autocreate is off. - Patch 14: tests for the above. - Patch 15: . skip the test when rustc is older than 1.87 and when clang is older than LLVM of rustc, instead of breaking the build. . the exit status of rustc was lost in the pipe and clang made an empty object. Go through a file. Follow BPF_STRICT_BUILD=0. v1: https://lore.kernel.org/bpf/20260930193127.2181684-1-alexei.starovoitov@gmail.com/ Signed-off-by: Alexei Starovoitov <ast@kernel.org> ==================== Link: https://patch.msgid.link/20261002124714.180012-1-alexei.starovoitov@gmail.com Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions