Skip to content

Commit a409401

Browse files
iii-iKernel Patches Daemon
authored andcommitted
selftests/bpf: Enable timed may_goto verifier tests on s390x
Now that the timed may_goto implementation is available on s390x, enable the respective verifier tests. Signed-off-by: Ilya Leoshkevich <[email protected]>
1 parent 7f79efa commit a409401

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void test_stream_errors(void)
7777
ASSERT_OK(ret, "ret");
7878
ASSERT_OK(opts.retval, "retval");
7979

80-
#if !defined(__x86_64__)
80+
#if !defined(__x86_64__) && !defined(__s390x__)
8181
ASSERT_TRUE(1, "Timed may_goto unsupported, skip.");
8282
if (i == 0) {
8383
ret = bpf_prog_stream_read(prog_fd, 2, buf, sizeof(buf), &ropts);

tools/testing/selftests/bpf/progs/verifier_may_goto_1.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
SEC("raw_tp")
1010
__description("may_goto 0")
1111
__arch_x86_64
12+
__arch_s390x
1213
__xlated("0: r0 = 1")
1314
__xlated("1: exit")
1415
__success
@@ -27,6 +28,7 @@ __naked void may_goto_simple(void)
2728
SEC("raw_tp")
2829
__description("batch 2 of may_goto 0")
2930
__arch_x86_64
31+
__arch_s390x
3032
__xlated("0: r0 = 1")
3133
__xlated("1: exit")
3234
__success
@@ -47,6 +49,7 @@ __naked void may_goto_batch_0(void)
4749
SEC("raw_tp")
4850
__description("may_goto batch with offsets 2/1/0")
4951
__arch_x86_64
52+
__arch_s390x
5053
__xlated("0: r0 = 1")
5154
__xlated("1: exit")
5255
__success
@@ -69,8 +72,9 @@ __naked void may_goto_batch_1(void)
6972
}
7073

7174
SEC("raw_tp")
72-
__description("may_goto batch with offsets 2/0 - x86_64")
75+
__description("may_goto batch with offsets 2/0 - x86_64 and s390x")
7376
__arch_x86_64
77+
__arch_s390x
7478
__xlated("0: *(u64 *)(r10 -16) = 65535")
7579
__xlated("1: *(u64 *)(r10 -8) = 0")
7680
__xlated("2: r11 = *(u64 *)(r10 -16)")
@@ -84,7 +88,7 @@ __xlated("9: r0 = 1")
8488
__xlated("10: r0 = 2")
8589
__xlated("11: exit")
8690
__success
87-
__naked void may_goto_batch_2_x86_64(void)
91+
__naked void may_goto_batch_2_x86_64_s390x(void)
8892
{
8993
asm volatile (
9094
".8byte %[may_goto1];"

0 commit comments

Comments
 (0)