]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Always start with clearing SVE flag on load
authorMarc Zyngier <maz@kernel.org>
Sat, 28 May 2022 11:38:11 +0000 (12:38 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 7 Jun 2022 13:19:23 +0000 (14:19 +0100)
commitcfd43942bf817e54df6cec16ff8da2b7b46db7b8
tree30c346e1000ad3c75da7f6940c9ee1618c93dab3
parentf040cca4b0da0180bf9de9141ef5c95f60f85182
KVM: arm64: Always start with clearing SVE flag on load

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: f20e938f2608 ("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
arch/arm64/kvm/fpsimd.c