Skip to content

Commit 11a7a42

Browse files
brooniectmarinas
authored andcommitted
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 <broonie@kernel.org> Link: https://lore.kernel.org/r/20230922-arm64-ssve-validate-svcr-v1-1-f518960eaeda@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 6465e26 commit 11a7a42

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@ function _start
473473
// mov x8, #__NR_sched_yield // Encourage preemption
474474
// svc #0
475475

476+
#ifdef SSVE
477+
mrs x0, S3_3_C4_C2_2 // SVCR should have ZA=0,SM=1
478+
and x1, x0, #3
479+
cmp x1, #1
480+
b.ne svcr_barf
481+
#endif
482+
476483
mov x21, #0
477484
0: mov x0, x21
478485
bl check_zreg
@@ -553,3 +560,15 @@ function vl_barf
553560
mov x1, #1
554561
svc #0
555562
endfunction
563+
564+
function svcr_barf
565+
mov x10, x0
566+
567+
puts "Bad SVCR: "
568+
mov x0, x10
569+
bl putdecn
570+
571+
mov x8, #__NR_exit
572+
mov x1, #1
573+
svc #0
574+
endfunction

0 commit comments

Comments
 (0)