Skip to content

Commit 82887c2

Browse files
eddyz87Alexei Starovoitov
authored andcommitted
selftests/bpf: verifier/unpriv converted to inline assembly
Test verifier/unpriv semi-automatically converted to use inline assembly. The verifier/unpriv.c had to be split in two parts: - the bulk of the tests is in the progs/verifier_unpriv.c; - the single test that needs `struct bpf_perf_event_data` definition is in the progs/verifier_unpriv_perf.c. The tests above can't be in a single file because: - first requires inclusion of the filter.h header (to get access to BPF_ST_MEM macro, inline assembler does not support this isntruction); - the second requires vmlinux.h, which contains definitions conflicting with filter.h. Signed-off-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 81d1d6d commit 82887c2

File tree

4 files changed

+764
-562
lines changed

4 files changed

+764
-562
lines changed

tools/testing/selftests/bpf/prog_tests/verifier.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
#include "verifier_stack_ptr.skel.h"
5757
#include "verifier_subreg.skel.h"
5858
#include "verifier_uninit.skel.h"
59+
#include "verifier_unpriv.skel.h"
60+
#include "verifier_unpriv_perf.skel.h"
5961
#include "verifier_value_adj_spill.skel.h"
6062
#include "verifier_value.skel.h"
6163
#include "verifier_value_or_null.skel.h"
@@ -150,6 +152,8 @@ void test_verifier_spin_lock(void) { RUN(verifier_spin_lock); }
150152
void test_verifier_stack_ptr(void) { RUN(verifier_stack_ptr); }
151153
void test_verifier_subreg(void) { RUN(verifier_subreg); }
152154
void test_verifier_uninit(void) { RUN(verifier_uninit); }
155+
void test_verifier_unpriv(void) { RUN(verifier_unpriv); }
156+
void test_verifier_unpriv_perf(void) { RUN(verifier_unpriv_perf); }
153157
void test_verifier_value_adj_spill(void) { RUN(verifier_value_adj_spill); }
154158
void test_verifier_value(void) { RUN(verifier_value); }
155159
void test_verifier_value_or_null(void) { RUN(verifier_value_or_null); }

0 commit comments

Comments
 (0)