]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Always start with clearing SVE flag on load
authorMarc Zyngier <maz@kernel.org>
Tue, 8 Apr 2025 18:09:57 +0000 (19:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:16 +0000 (07:44 +0200)
commit58ed930115b8ec260d5cd74b6e3178e4aa5fa8c1
tree23fe664d101aa80baa11c16542c21ca3f14b9f33
parenta2231da36777dd753a2d375294c58839ca34a41c
KVM: arm64: Always start with clearing SVE flag on load

[ Upstream commit d52d165d67c5aa26c8c89909003c94a66492d23d ]

On each vcpu load, we set the KVM_ARM64_HOST_SVE_ENABLED
flag if SVE is enabled for EL0 on the host. This is used to restore
the correct state on vpcu put.

However, it appears that nothing ever clears this flag. Once
set, it will stick until the vcpu is destroyed, which has the
potential to spuriously enable SVE for userspace.

We probably never saw the issue because no VMM uses SVE, but
that's still pretty bad. Unconditionally clearing the flag
on vcpu load addresses the issue.

Fixes: 8383741ab2e7 ("KVM: arm64: Get rid of host SVE tracking/saving")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220528113829.1043361-2-maz@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kvm/fpsimd.c