summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-10-31 21:55:35 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-11-02 22:20:00 +0000
commit1ddffb57b36239e84b8224b12e34b87f6031b29c (patch)
tree94614d7a5a97d05246ccd25d9fb44ca9548b4ddd /scripts/basic
parent29f85bba33ff515e2c084450ec4b1ccc53550d5d (diff)
downloadlinux-1ddffb57b36239e84b8224b12e34b87f6031b29c.tar.gz
linux-1ddffb57b36239e84b8224b12e34b87f6031b29c.zip
bpf: Emit timed may_goto for JITed progs only
The timed form of may_goto calls arch_bpf_timed_may_goto(). This function takes its argument and returns its result in BPF_REG_AX, in a register of the cpu. Only JITed code can call it. The verifier emits the timed form when the arch has a JIT that supports it. It does not look at the prog. With CONFIG_BPF_JIT_ALWAYS_ON=n the interpreter can run such a prog: the JIT is off, or it fails. The interpreter calls the function like a helper. The function takes what the C code left in that register for a pointer, and bpf_check_timed_may_goto() reads and writes through it. Emit the timed form only when the prog asks for a JIT, and make the JIT mandatory for such a prog. All other progs get the form that counts down from BPF_MAX_LOOPS. One test of verifier_may_goto_1 shows the insns of the timed form. Load it only when progs are JITed. Fixes: e723608bf428 ("bpf: Add verifier support for timed may_goto") Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261031215543.682284-2-alexei.starovoitov@gmail.com
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions