summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/verifier.c
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2023-04-21 20:42:32 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-04-21 22:26:52 +0300
commit82887c2568e4f78d5cfcb85bf3cdc056dfd97c85 (patch)
tree8b0a1dd515525c0daf9a74fe0b61c8b9614f95b0 /tools/testing/selftests/bpf/prog_tests/verifier.c
parent81d1d6dd4037755b98bf9b9f9d0dbd715b1734e5 (diff)
downloadlinux-82887c2568e4f78d5cfcb85bf3cdc056dfd97c85.tar.xz
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 <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20230421174234.2391278-23-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/verifier.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/verifier.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/verifier.c b/tools/testing/selftests/bpf/prog_tests/verifier.c
index 8eb36cbf00bd..a2754ea49b19 100644
--- a/tools/testing/selftests/bpf/prog_tests/verifier.c
+++ b/tools/testing/selftests/bpf/prog_tests/verifier.c
@@ -56,6 +56,8 @@
#include "verifier_stack_ptr.skel.h"
#include "verifier_subreg.skel.h"
#include "verifier_uninit.skel.h"
+#include "verifier_unpriv.skel.h"
+#include "verifier_unpriv_perf.skel.h"
#include "verifier_value_adj_spill.skel.h"
#include "verifier_value.skel.h"
#include "verifier_value_or_null.skel.h"
@@ -150,6 +152,8 @@ void test_verifier_spin_lock(void) { RUN(verifier_spin_lock); }
void test_verifier_stack_ptr(void) { RUN(verifier_stack_ptr); }
void test_verifier_subreg(void) { RUN(verifier_subreg); }
void test_verifier_uninit(void) { RUN(verifier_uninit); }
+void test_verifier_unpriv(void) { RUN(verifier_unpriv); }
+void test_verifier_unpriv_perf(void) { RUN(verifier_unpriv_perf); }
void test_verifier_value_adj_spill(void) { RUN(verifier_value_adj_spill); }
void test_verifier_value(void) { RUN(verifier_value); }
void test_verifier_value_or_null(void) { RUN(verifier_value_or_null); }