Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <thiago.bauermann@linaro.org>
Tested-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241001-arm64-gcs-v13-39-222b78d87eee@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
bb9ae1a6 05e6cfff

+23
+15
tools/testing/selftests/arm64/fp/assembler.h
··· 65 65 bl puts 66 66 .endm 67 67 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 + 68 83 #endif /* ! ASSEMBLER_H */
+2
tools/testing/selftests/arm64/fp/fpsimd-test.S
··· 215 215 // Main program entry point 216 216 .globl _start 217 217 function _start 218 + enable_gcs 219 + 218 220 mov x23, #0 // signal count 219 221 220 222 mov w0, #SIGINT
+2
tools/testing/selftests/arm64/fp/sve-test.S
··· 378 378 // Main program entry point 379 379 .globl _start 380 380 function _start 381 + enable_gcs 382 + 381 383 mov x23, #0 // Irritation signal count 382 384 383 385 mov w0, #SIGINT
+2
tools/testing/selftests/arm64/fp/za-test.S
··· 231 231 // Main program entry point 232 232 .globl _start 233 233 function _start 234 + enable_gcs 235 + 234 236 mov x23, #0 // signal count 235 237 236 238 mov w0, #SIGINT
+2
tools/testing/selftests/arm64/fp/zt-test.S
··· 200 200 // Main program entry point 201 201 .globl _start 202 202 function _start 203 + enable_gcs 204 + 203 205 mov x23, #0 // signal count 204 206 205 207 mov w0, #SIGINT