Skip to content

Commit 4c14d1c

Browse files
Vasily GorbikMartin Schwidefsky
authored andcommitted
rseq/selftests: add s390 support
Implement support for s390 in the rseq selftests, in order to sanity check the recently enabled rseq syscall. The Implementation covers both 64-bit and 31-bit mode. Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 26f8438 commit 4c14d1c

3 files changed

Lines changed: 539 additions & 0 deletions

File tree

‎tools/testing/selftests/rseq/param_test.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,30 @@ unsigned int yield_mod_cnt, nr_abort;
9090
#error "Unsupported architecture"
9191
#endif
9292

93+
#elif defined(__s390__)
94+
95+
#define RSEQ_INJECT_INPUT \
96+
, [loop_cnt_1]"m"(loop_cnt[1]) \
97+
, [loop_cnt_2]"m"(loop_cnt[2]) \
98+
, [loop_cnt_3]"m"(loop_cnt[3]) \
99+
, [loop_cnt_4]"m"(loop_cnt[4]) \
100+
, [loop_cnt_5]"m"(loop_cnt[5]) \
101+
, [loop_cnt_6]"m"(loop_cnt[6])
102+
103+
#define INJECT_ASM_REG "r12"
104+
105+
#define RSEQ_INJECT_CLOBBER \
106+
, INJECT_ASM_REG
107+
108+
#define RSEQ_INJECT_ASM(n) \
109+
"l %%" INJECT_ASM_REG ", %[loop_cnt_" #n "]\n\t" \
110+
"ltr %%" INJECT_ASM_REG ", %%" INJECT_ASM_REG "\n\t" \
111+
"je 333f\n\t" \
112+
"222:\n\t" \
113+
"ahi %%" INJECT_ASM_REG ", -1\n\t" \
114+
"jnz 222b\n\t" \
115+
"333:\n\t"
116+
93117
#elif defined(__ARMEL__)
94118

95119
#define RSEQ_INJECT_INPUT \

0 commit comments

Comments
 (0)