[PATCH v2 07/11] kselftest/arm64: Remove the sched_yield()s from the fp-stress loads

From: Mark Brown

Date: Thu Nov 05 2026 - 09:22:00 EST


The fp-stress load programs call sched_yield() on each iteration of
their test loops in order to encourage preemption, except for sve-test
where the call is commented out since the SVE state is destroyed by
system calls. This is most likely counterproductive since we are more
likely to notice corruption if preemption happens while setting or
reading the register state, and since fp-stress starts multiple test
programs per CPU we should have no trouble observing preemption anyway.

Remove these calls, including the commented out one in sve-test, both
due to this and in order to prepare for running as KVM guests.

We also remove the inclusions of unistd.h since we no longer need it in
any of the programs. za-test had an unreferenced local label in the
middle of the sched_yield(), remove that too.

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
tools/testing/selftests/arm64/fp/fpsimd-test.S | 5 -----
tools/testing/selftests/arm64/fp/sve-test.S | 5 -----
tools/testing/selftests/arm64/fp/za-test.S | 5 -----
tools/testing/selftests/arm64/fp/zt-test.S | 4 ----
4 files changed, 19 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/fpsimd-test.S b/tools/testing/selftests/arm64/fp/fpsimd-test.S
index df040283d076..5e19799f1b2e 100644
--- a/tools/testing/selftests/arm64/fp/fpsimd-test.S
+++ b/tools/testing/selftests/arm64/fp/fpsimd-test.S
@@ -10,7 +10,6 @@
// (leave it running for as long as you want...)
// kill $pids

-#include <asm/unistd.h>
#include "assembler.h"
#include "asm-offsets.h"

@@ -185,10 +184,6 @@ function main
cmp x21, #NVR
b.lo 0b

-// Can't do this when SVE state is volatile across SVC:
- mov x8, #__NR_sched_yield // Encourage preemption
- svc #0
-
mov x21, #0
0: mov x0, x21
bl check_vreg
diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
index a1925761ae39..113411055afa 100644
--- a/tools/testing/selftests/arm64/fp/sve-test.S
+++ b/tools/testing/selftests/arm64/fp/sve-test.S
@@ -10,7 +10,6 @@
// (leave it running for as long as you want...)
// kill $pids

-#include <asm/unistd.h>
#include "assembler.h"
#include "asm-offsets.h"
#include "sme-inst.h"
@@ -378,10 +377,6 @@ function main
cmp x21, #NZR + NPR
b.lo 0b

-// Can't do this when SVE state is volatile across SVC:
-// 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
diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S
index 3fb9ac5c8f8b..3036b165e81c 100644
--- a/tools/testing/selftests/arm64/fp/za-test.S
+++ b/tools/testing/selftests/arm64/fp/za-test.S
@@ -10,7 +10,6 @@
// (leave it running for as long as you want...)
// kill $pids

-#include <asm/unistd.h>
#include "assembler.h"
#include "asm-offsets.h"
#include "sme-inst.h"
@@ -203,10 +202,6 @@ function main
subs x21, x21, #1
b.ne 0b

- mov x8, #__NR_sched_yield // encourage preemption
-1:
- svc #0
-
mrs x0, S3_3_C4_C2_2 // SVCR should have ZA=1,SM=0
and x1, x0, #3
cmp x1, #2
diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S
index 39af1c96a4e5..ae851c139d28 100644
--- a/tools/testing/selftests/arm64/fp/zt-test.S
+++ b/tools/testing/selftests/arm64/fp/zt-test.S
@@ -6,7 +6,6 @@
// Repeatedly writes unique test patterns into ZT0
// and reads them back to verify integrity.

-#include <asm/unistd.h>
#include "assembler.h"
#include "asm-offsets.h"
#include "sme-inst.h"
@@ -143,9 +142,6 @@ function main
mov x1, x22
bl setup_zt

- mov x8, #__NR_sched_yield // Encourage preemption
- svc #0
-
mrs x0, S3_3_C4_C2_2 // SVCR should have ZA=1,SM=0
and x1, x0, #3
cmp x1, #2

--
2.47.3