Commit edaea8e
selftests/bpf: Skip callback tests if jit is disabled in test_verifier
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
torvalds#106/p inline simple bpf_loop call FAIL
torvalds#107/p don't inline bpf_loop call, flags non-zero FAIL
torvalds#108/p don't inline bpf_loop call, callback non-constant FAIL
torvalds#109/p bpf_loop_inline and a dead func FAIL
torvalds#110/p bpf_loop_inline stack locations for loop vars FAIL
torvalds#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, copy some check functions from the other places under
tools directory, and then handle this case in do_test_single().
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
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>1 parent e3c12a7 commit edaea8e
1 file changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
1355 | 1356 | | |
1356 | 1357 | | |
1357 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1358 | 1369 | | |
1359 | 1370 | | |
1360 | 1371 | | |
| |||
1619 | 1630 | | |
1620 | 1631 | | |
1621 | 1632 | | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1622 | 1643 | | |
1623 | 1644 | | |
1624 | 1645 | | |
| |||
1844 | 1865 | | |
1845 | 1866 | | |
1846 | 1867 | | |
| 1868 | + | |
| 1869 | + | |
1847 | 1870 | | |
1848 | 1871 | | |
1849 | 1872 | | |
| |||
0 commit comments