mirror of
https://github.com/torvalds/linux.git
synced 2025-11-12 06:29:40 +02:00
If CONFIG_BPF_JIT_ALWAYS_ON is not set and bpf_jit_enable is 0, there exist 6 failed tests. [root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable [root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled [root@linux bpf]# ./test_verifier | grep FAIL #106/p inline simple bpf_loop call FAIL #107/p don't inline bpf_loop call, flags non-zero FAIL #108/p don't inline bpf_loop call, callback non-constant FAIL #109/p bpf_loop_inline and a dead func FAIL #110/p bpf_loop_inline stack locations for loop vars FAIL #111/p inline bpf_loop call in a big program FAIL Summary: 768 PASSED, 15 SKIPPED, 6 FAILED The test log shows that callbacks are not allowed in non-JITed programs, interpreter doesn't support them yet, thus these tests should be skipped if jit is disabled. Add an explicit flag F_NEEDS_JIT_ENABLED to those tests to mark that they require JIT enabled in bpf_loop_inline.c, check the flag and jit_disabled at the beginning of do_test_single() to handle this case. With this patch: [root@linux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable [root@linux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled [root@linux bpf]# ./test_verifier | grep FAIL Summary: 768 PASSED, 21 SKIPPED, 0 FAILED Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240123090351.2207-3-yangtiezhu@loongson.cn |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| atomic_and.c | ||
| atomic_bounds.c | ||
| atomic_cmpxchg.c | ||
| atomic_fetch.c | ||
| atomic_fetch_add.c | ||
| atomic_invalid.c | ||
| atomic_or.c | ||
| atomic_xchg.c | ||
| atomic_xor.c | ||
| basic.c | ||
| basic_call.c | ||
| basic_instr.c | ||
| basic_stx_ldx.c | ||
| bpf_loop_inline.c | ||
| bpf_st_mem.c | ||
| calls.c | ||
| ctx_sk_lookup.c | ||
| ctx_skb.c | ||
| dead_code.c | ||
| direct_value_access.c | ||
| event_output.c | ||
| jit.c | ||
| jmp32.c | ||
| jset.c | ||
| jump.c | ||
| junk_insn.c | ||
| ld_abs.c | ||
| ld_dw.c | ||
| ld_imm64.c | ||
| map_kptr.c | ||
| perf_event_sample_period.c | ||
| precise.c | ||
| scale.c | ||
| sleepable.c | ||
| wide_access.c | ||