[PATCH v2 00/11] kselftest/arm64: Add coverage of interactions with KVM to fp-stress
From: Mark Brown
Date: Thu Nov 05 2026 - 09:15:12 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>
---
Changes in v2:
- Rebase onto v7.4-rc1.
- Use PHDRS in the linker script rather than suppressing RWX warnings.
- Use SMC to invoke PSCI at EL2.
- Commit mesage clarifications.
- Rename ASM_UTILS to ASM_UTILS_LINUX in the first patch to reduce
churn.
- Remove more commented out dead code.
- Fix cross build of the guest code with LLVM, use llvm-objcopy.
- Drop protected guest support, we were only working due to missing
permission checks.
- Link to v1: https://patch.msgid.link/20260901-arm64-fp-stress-kvm-v1-0-31bce995b49b@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 | 66 ++-
tools/testing/selftests/arm64/fp/asm-utils-kvm.S | 93 ++++
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 | 65 +++
tools/testing/selftests/arm64/fp/fp-stress-vmm.c | 586 +++++++++++++++++++++
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 | 144 +----
tools/testing/selftests/arm64/fp/za-test.S | 144 +----
tools/testing/selftests/arm64/fp/zt-test.S | 137 +----
14 files changed, 1250 insertions(+), 580 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm master
change-id: 20250401-arm64-fp-stress-kvm-4720ca307da4
Best regards,
--
Mark Brown <broonie@xxxxxxxxxx>