]> www.infradead.org Git - users/hch/misc.git/commitdiff
selftests/bpf: Enable timed may_goto verifier tests on s390x
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 21 Aug 2025 11:25:58 +0000 (13:25 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 26 Aug 2025 23:51:52 +0000 (16:51 -0700)
Now that the timed may_goto implementation is available on s390x,
enable the respective verifier tests.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20250821113339.292434-5-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/stream.c
tools/testing/selftests/bpf/progs/verifier_may_goto_1.c

index d9f0185dca61b8f6e2a4c4645e381a62b0918733..36a1a1ebde69292583a087d1207270b5f16cd45a 100644 (file)
@@ -77,7 +77,7 @@ void test_stream_errors(void)
                ASSERT_OK(ret, "ret");
                ASSERT_OK(opts.retval, "retval");
 
-#if !defined(__x86_64__)
+#if !defined(__x86_64__) && !defined(__s390x__)
                ASSERT_TRUE(1, "Timed may_goto unsupported, skip.");
                if (i == 0) {
                        ret = bpf_prog_stream_read(prog_fd, 2, buf, sizeof(buf), &ropts);
index 3966d827f28892a5a9a521e550e1dfafea5783cd..cc1063863569d8d65292213af1fb40aa6c88aca9 100644 (file)
@@ -9,6 +9,7 @@
 SEC("raw_tp")
 __description("may_goto 0")
 __arch_x86_64
+__arch_s390x
 __xlated("0: r0 = 1")
 __xlated("1: exit")
 __success
@@ -27,6 +28,7 @@ __naked void may_goto_simple(void)
 SEC("raw_tp")
 __description("batch 2 of may_goto 0")
 __arch_x86_64
+__arch_s390x
 __xlated("0: r0 = 1")
 __xlated("1: exit")
 __success
@@ -47,6 +49,7 @@ __naked void may_goto_batch_0(void)
 SEC("raw_tp")
 __description("may_goto batch with offsets 2/1/0")
 __arch_x86_64
+__arch_s390x
 __xlated("0: r0 = 1")
 __xlated("1: exit")
 __success
@@ -69,8 +72,9 @@ __naked void may_goto_batch_1(void)
 }
 
 SEC("raw_tp")
-__description("may_goto batch with offsets 2/0 - x86_64")
+__description("may_goto batch with offsets 2/0 - x86_64 and s390x")
 __arch_x86_64
+__arch_s390x
 __xlated("0: *(u64 *)(r10 -16) = 65535")
 __xlated("1: *(u64 *)(r10 -8) = 0")
 __xlated("2: r11 = *(u64 *)(r10 -16)")
@@ -84,7 +88,7 @@ __xlated("9: r0 = 1")
 __xlated("10: r0 = 2")
 __xlated("11: exit")
 __success
-__naked void may_goto_batch_2_x86_64(void)
+__naked void may_goto_batch_2_x86_64_s390x(void)
 {
        asm volatile (
        ".8byte %[may_goto1];"