]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: selftests: Add test for SVE host corruption
authorMark Brown <broonie@kernel.org>
Wed, 16 Apr 2025 23:32:49 +0000 (00:32 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 6 May 2025 08:50:56 +0000 (09:50 +0100)
commite0ccc45b056d626d4b271820faeedf3837337ceb
treeb61d89089fe57033cd1e64d51211dcfd6ac7e012
parentbae247ccade0a5016031e73c9f6d61b758b612d8
KVM: arm64: selftests: Add test for SVE host corruption

Until recently, the kernel could unexpectedly discard SVE state for a
period after a KVM_RUN ioctl, when the guest did not execute any
FPSIMD/SVE/SME instructions. We fixed that issue in commit:

  fbc7e61195e2 ("KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state")

Add a test which tries to provoke that issue by manipulating SVE state
before/after running a guest which does not execute any FPSIMD/SVE/SME
instructions. The test executes a handful of iterations to miminize
the risk that the issue is masked by preemption.

Signed-off--by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250417-kvm-selftest-sve-signal-v1-1-6330c2f3da0c@kernel.org
[maz: Restored MR's SoB, fixed commit message according to MR's write-up]
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/arm64/host_sve.c [new file with mode: 0644]