Commit 7af0d5e5 authored by Fuad Tabba's avatar Fuad Tabba Committed by Oliver Upton

KVM: arm64: Fix resetting SVE trap values on reset for hVHE

Ensure that SVE traps are disabled for hVHE, if the FPSIMD state
isn't owned by the guest, when getting the reset value for the
architectural feature control register.

Fixes: 75c76ab5 ("KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration")
Signed-off-by: default avatarFuad Tabba <tabba@google.com>
Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-8-tabba@google.comSigned-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
parent a9626099
......@@ -588,6 +588,10 @@ static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
CPACR_EL1_ZEN_EL1EN);
} else if (has_hvhe()) {
val = (CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN);
if (!vcpu_has_sve(vcpu) ||
(vcpu->arch.fp_state != FP_STATE_GUEST_OWNED))
val |= CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN;
} else {
val = CPTR_NVHE_EL2_RES1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment