kselftest/arm64: Log SVCR when the SME tests barf
authorMark Brown <broonie@kernel.org>
Tue, 5 Dec 2023 14:24:44 +0000 (14:24 +0000)
committerWill Deacon <will@kernel.org>
Mon, 11 Dec 2023 12:02:00 +0000 (12:02 +0000)
On failure we log the actual and expected value of the register we detect
a mismatch in. For SME one obvious potential source of corruption would be
if we had corrupted SVCR since changes in streaming mode will reset the
register values, log the value to aid in understanding issues.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231205-arm64-kselftest-log-svcr-v1-1-b77abd9ee7f3@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
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 547d077e351727b4edc237ea5d4e136d8d743b4a..fff60e2a25addfd4850ef71aa3cf6535ac880ffd 100644 (file)
@@ -515,6 +515,10 @@ function barf
        mov     x11, x1 // actual data
        mov     x12, x2 // data size
 
+#ifdef SSVE
+       mrs     x13, S3_3_C4_C2_2
+#endif
+
        puts    "Mismatch: PID="
        mov     x0, x20
        bl      putdec
@@ -534,6 +538,12 @@ function barf
        bl      dumphex
        puts    "]\n"
 
+#ifdef SSVE
+       puts    "\tSVCR: "
+       mov     x0, x13
+       bl      putdecn
+#endif
+
        mov     x8, #__NR_getpid
        svc     #0
 // fpsimd.c acitivty log dump hack
index 9dcd70911397545552d104d66e926c99ab3a9652..095b45531640966e685408057c08ada67e68998b 100644 (file)
@@ -333,6 +333,9 @@ function barf
 //     mov     w8, #__NR_exit
 //     svc     #0
 // end hack
+
+       mrs     x13, S3_3_C4_C2_2
+
        smstop
        mov     x10, x0 // expected data
        mov     x11, x1 // actual data
@@ -356,6 +359,9 @@ function barf
        mov     x1, x12
        bl      dumphex
        puts    "]\n"
+       puts    "\tSVCR: "
+       mov     x0, x13
+       bl      putdecn
 
        mov     x8, #__NR_getpid
        svc     #0
index d632863976380b181da77586433ef59aa66f95ad..b5c81e81a37946c1bffe810568855939e9ceb08e 100644 (file)
@@ -267,6 +267,8 @@ function barf
 //     mov     w8, #__NR_exit
 //     svc     #0
 // end hack
+
+       mrs     x13, S3_3_C4_C2_2
        smstop
        mov     x10, x0 // expected data
        mov     x11, x1 // actual data
@@ -287,6 +289,9 @@ function barf
        mov     x1, x12
        bl      dumphex
        puts    "]\n"
+       puts    "\tSVCR: "
+       mov     x0, x13
+       bl      putdecn
 
        mov     x8, #__NR_getpid
        svc     #0