Commit 68dfce56 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

UPSTREAM: KVM: arm64: Always start with clearing SME flag on load



On each vcpu load, we set the KVM_ARM64_HOST_SME_ENABLED
flag if SME 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 SME for userspace. As it turns
out, this is due to the SME code being more or less copied from
SVE, and inheriting the same shortcomings.

We never saw the issue because nothing uses SME, and the amount
of testing is probably still pretty low.

Fixes: 861262ab ("KVM: arm64: Handle SME host state when running guests")
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Reviwed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220528113829.1043361-3-maz@kernel.org


(cherry picked from commit 039f49c4)
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: Ib1469725d873889fc89a36d21baee2501f327c9f
parent 8649ba29
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment