]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kselftest/arm64: Enable GCS for the FP stress tests
authorMark Brown <broonie@kernel.org>
Tue, 1 Oct 2024 22:59:18 +0000 (23:59 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Oct 2024 11:04:46 +0000 (12:04 +0100)
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>
tools/testing/selftests/arm64/fp/assembler.h
tools/testing/selftests/arm64/fp/fpsimd-test.S
tools/testing/selftests/arm64/fp/sve-test.S
tools/testing/selftests/arm64/fp/za-test.S
tools/testing/selftests/arm64/fp/zt-test.S

index 9b38a0da407d8b0aedde64287b845f9ad50dacf1..1fc46a5642c29cc84e8ccaf29c266f0e03ffd739 100644 (file)
@@ -65,4 +65,19 @@ endfunction
        bl      puts
 .endm
 
+#define PR_SET_SHADOW_STACK_STATUS      75
+# define PR_SHADOW_STACK_ENABLE         (1UL << 0)
+
+.macro enable_gcs
+       // Run with GCS
+       mov     x0, PR_SET_SHADOW_STACK_STATUS
+       mov     x1, PR_SHADOW_STACK_ENABLE
+       mov     x2, xzr
+       mov     x3, xzr
+       mov     x4, xzr
+       mov     x5, xzr
+       mov     x8, #__NR_prctl
+       svc     #0
+.endm
+
 #endif /* ! ASSEMBLER_H */
index 8b960d01ed2e0ef516893b68794078ddf8c01e1f..b16fb7f42e3e471c3b4c4e73c826a9cb5a09c309 100644 (file)
@@ -215,6 +215,8 @@ endfunction
 // Main program entry point
 .globl _start
 function _start
+       enable_gcs
+
        mov     x23, #0         // signal count
 
        mov     w0, #SIGINT
index fff60e2a25addfd4850ef71aa3cf6535ac880ffd..2fb4f0b84476b1e6e547a509148fcebc05bc4fd6 100644 (file)
@@ -378,6 +378,8 @@ endfunction
 // Main program entry point
 .globl _start
 function _start
+       enable_gcs
+
        mov     x23, #0         // Irritation signal count
 
        mov     w0, #SIGINT
index 095b45531640966e685408057c08ada67e68998b..b2603aba99de895f337de8554f30044bab39f17b 100644 (file)
@@ -231,6 +231,8 @@ endfunction
 // Main program entry point
 .globl _start
 function _start
+       enable_gcs
+
        mov     x23, #0         // signal count
 
        mov     w0, #SIGINT
index b5c81e81a37946c1bffe810568855939e9ceb08e..8d9609a490085440fdf4a4801578a03bce3ec6f8 100644 (file)
@@ -200,6 +200,8 @@ endfunction
 // Main program entry point
 .globl _start
 function _start
+       enable_gcs
+
        mov     x23, #0         // signal count
 
        mov     w0, #SIGINT