]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: nv: Enable vSErrors when HCRX_EL2.TMEA is set
authorOliver Upton <oliver.upton@linux.dev>
Tue, 8 Jul 2025 17:25:25 +0000 (10:25 -0700)
committerOliver Upton <oliver.upton@linux.dev>
Tue, 8 Jul 2025 18:36:35 +0000 (11:36 -0700)
Per R_CDCKC, vSErrors are enabled if HCRX_EL2.TMEA is set, regardless of
HCR_EL2.AMO.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250708172532.1699409-21-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/include/asm/kvm_emulate.h

index 71ecdc20523eee5a37381b49ebd5af7afae1e365..fa8a08a1ccd5c45a99717b7dd912ac948c1de152 100644 (file)
@@ -259,7 +259,11 @@ static inline bool is_nested_ctxt(struct kvm_vcpu *vcpu)
 
 static inline bool vserror_state_is_nested(struct kvm_vcpu *vcpu)
 {
-       return is_nested_ctxt(vcpu) && vcpu_el2_amo_is_set(vcpu);
+       if (!is_nested_ctxt(vcpu))
+               return false;
+
+       return vcpu_el2_amo_is_set(vcpu) ||
+              (__vcpu_sys_reg(vcpu, HCRX_EL2) & HCRX_EL2_TMEA);
 }
 
 /*