Skip to content

Commit bb9ae1a

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Enable GCS for the FP stress tests
While it's a bit off topic for them the floating point stress tests do give us some coverage of context thrashing cases, and also of active signal delivery separate to the relatively complicated framework in the actual signals tests. Have the tests enable GCS on startup, ignoring failures so they continue to work as before on systems without GCS. Reviewed-by: Thiago Jung Bauermann <[email protected]> Tested-by: Thiago Jung Bauermann <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 05e6cff commit bb9ae1a

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

tools/testing/selftests/arm64/fp/assembler.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,19 @@ endfunction
6565
bl puts
6666
.endm
6767

68+
#define PR_SET_SHADOW_STACK_STATUS 75
69+
# define PR_SHADOW_STACK_ENABLE (1UL << 0)
70+
71+
.macro enable_gcs
72+
// Run with GCS
73+
mov x0, PR_SET_SHADOW_STACK_STATUS
74+
mov x1, PR_SHADOW_STACK_ENABLE
75+
mov x2, xzr
76+
mov x3, xzr
77+
mov x4, xzr
78+
mov x5, xzr
79+
mov x8, #__NR_prctl
80+
svc #0
81+
.endm
82+
6883
#endif /* ! ASSEMBLER_H */

tools/testing/selftests/arm64/fp/fpsimd-test.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ endfunction
215215
// Main program entry point
216216
.globl _start
217217
function _start
218+
enable_gcs
219+
218220
mov x23, #0 // signal count
219221

220222
mov w0, #SIGINT

tools/testing/selftests/arm64/fp/sve-test.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ endfunction
378378
// Main program entry point
379379
.globl _start
380380
function _start
381+
enable_gcs
382+
381383
mov x23, #0 // Irritation signal count
382384

383385
mov w0, #SIGINT

tools/testing/selftests/arm64/fp/za-test.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ endfunction
231231
// Main program entry point
232232
.globl _start
233233
function _start
234+
enable_gcs
235+
234236
mov x23, #0 // signal count
235237

236238
mov w0, #SIGINT

tools/testing/selftests/arm64/fp/zt-test.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ endfunction
200200
// Main program entry point
201201
.globl _start
202202
function _start
203+
enable_gcs
204+
203205
mov x23, #0 // signal count
204206

205207
mov w0, #SIGINT

0 commit comments

Comments
 (0)