2023-09-22 13:45:15

by Mark Brown

[permalink] [raw]
Subject: [PATCH] kselftest/arm64: Validate SVCR in streaming SVE stress test

In the ZA and ZT test programs we explicitly validate that PSTATE.ZA is as
expected on each loop but we do not do the equivalent for our streaming
SVE test, add a check that we are still in streaming mode on every loop
in case that goes wrong.

Signed-off-by: Mark Brown <[email protected]>
---
tools/testing/selftests/arm64/fp/sve-test.S | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
index 4328895dfc87..547d077e3517 100644
--- a/tools/testing/selftests/arm64/fp/sve-test.S
+++ b/tools/testing/selftests/arm64/fp/sve-test.S
@@ -473,6 +473,13 @@ function _start
// mov x8, #__NR_sched_yield // Encourage preemption
// svc #0

+#ifdef SSVE
+ mrs x0, S3_3_C4_C2_2 // SVCR should have ZA=0,SM=1
+ and x1, x0, #3
+ cmp x1, #1
+ b.ne svcr_barf
+#endif
+
mov x21, #0
0: mov x0, x21
bl check_zreg
@@ -553,3 +560,15 @@ function vl_barf
mov x1, #1
svc #0
endfunction
+
+function svcr_barf
+ mov x10, x0
+
+ puts "Bad SVCR: "
+ mov x0, x10
+ bl putdecn
+
+ mov x8, #__NR_exit
+ mov x1, #1
+ svc #0
+endfunction

---
base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
change-id: 20230921-arm64-ssve-validate-svcr-316852554fc8

Best regards,
--
Mark Brown <[email protected]>


2023-09-25 17:25:44

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] kselftest/arm64: Validate SVCR in streaming SVE stress test

On Fri, 22 Sep 2023 14:42:55 +0100, Mark Brown wrote:
> In the ZA and ZT test programs we explicitly validate that PSTATE.ZA is as
> expected on each loop but we do not do the equivalent for our streaming
> SVE test, add a check that we are still in streaming mode on every loop
> in case that goes wrong.
>
>

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Validate SVCR in streaming SVE stress test
https://git.kernel.org/arm64/c/11a7a42ea76e

--
Catalin