[PATCH 00/11] kselftest/arm64: Add coverage of interactions with KVM to fp-stress

From: Mark Brown

Date: Tue Sep 01 2026 - 14:06:25 EST


Presently we don't have any automatic stress testing for the handling of
floating point save and restore with KVM, nor it's interaction with the
host's management of the floating point registers. The majority of the
focused stress testing has been done by running the existing fp-stress
selftest on the host, starting a guest and then running fp-stress in
there too but this has been a manual process rather than something done
as a matter of routine by CI.

Plug this gap by reworking the test loads so that they can be run as KVM
guests, using a simple VMM that provides the interface that fp-stress
expects from it's test loads. We run the FPSIMD and SVE tests in KVM
guests for half the CPUs, if EL2 is available then half the KVM tests
will use it. The tests run in a minimal environment with the VMM and
test binaries tightly coupled to each other.

There's more coverage could be added, but this is an improvement over
the current situation and can be built on in future. Off the top of my
head:

- We only test nested guests running at EL2 with E2H set.
- We only run the guests at the highest VL they support.
- Enabling the MMU would avoid surprises due to the performance
differences.
- We do not run any protected guests (this currently taints the kernel
so should wait until the pKVM support is less experimental).
- It might be useful to have the VMM signal handler save and restore
the guest register state to exercise that path.
- Possibly it would be useful to disable irrelevant features so less
time is spent context switching non-FP state?

Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
Mark Brown (11):
kselftest/arm64: Factor Linux syscalls out of asm-utils.S
kselftest/arm64: Factor shared signal handlers out of fp-stress loads
kselftest/arm64: Move exit calls out of fp-stress loads
kselftest/arm64: Use exit_error() rather than SIGABRT in fp-stress
kselftest/arm64: Exit with an error code on data mismatches in fp-stress
kselftest/arm64: Factor startup code out of fp-stress load programs
kselftest/arm64: Remove the sched_yield()s from the fp-stress loads
kselftest/arm64: Add a very simple VMM for use in fp-stress
kselftest/arm64: Build KVM guest versions of the fp-stress loads
kselftest/arm64: Use execv() to start fp-stress test loads
kselftest/arm64: Run KVM guests from fp-stress

tools/testing/selftests/arm64/fp/.gitignore | 4 +
tools/testing/selftests/arm64/fp/Makefile | 64 ++-
tools/testing/selftests/arm64/fp/asm-utils-kvm.S | 86 +++
tools/testing/selftests/arm64/fp/asm-utils-linux.S | 181 +++++++
tools/testing/selftests/arm64/fp/asm-utils.S | 36 --
tools/testing/selftests/arm64/fp/fp-pidbench.S | 6 +-
.../testing/selftests/arm64/fp/fp-stress-kvm.lds.S | 58 ++
tools/testing/selftests/arm64/fp/fp-stress-vmm.c | 596 +++++++++++++++++++++
tools/testing/selftests/arm64/fp/fp-stress-vmm.h | 17 +
tools/testing/selftests/arm64/fp/fp-stress.c | 230 +++++++-
tools/testing/selftests/arm64/fp/fpsimd-test.S | 121 +----
tools/testing/selftests/arm64/fp/sve-test.S | 139 +----
tools/testing/selftests/arm64/fp/za-test.S | 138 +----
tools/testing/selftests/arm64/fp/zt-test.S | 131 +----
14 files changed, 1244 insertions(+), 563 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20250401-arm64-fp-stress-kvm-4720ca307da4

Best regards,
--
Mark Brown <broonie@xxxxxxxxxx>