Commit 9df9186f authored by Fuad Tabba's avatar Fuad Tabba Committed by Marc Zyngier
Browse files

KVM: arm64: Fix RAS trapping in pKVM for protected VMs



Trap RAS in pKVM if not supported at all for protected VMs. The
RAS version doesn't matter in this case.

Fixes: 2a0c3433 ("KVM: arm64: Initialize trap registers for protected VMs")
Signed-off-by: default avatarFuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20241216105057.579031-8-tabba@google.com


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 7ba5b8f8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -70,9 +70,8 @@ static void pvm_init_traps_hcr(struct kvm_vcpu *vcpu)
	 */
	val |= HCR_TACR | HCR_TIDCP | HCR_TID3 | HCR_TID1;

	/* Trap RAS unless all current versions are supported */
	if (FIELD_GET(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_RAS), id_aa64pfr0) <
	    ID_AA64PFR0_EL1_RAS_V1P1) {
	/* Trap RAS */
	if (!FIELD_GET(ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_RAS), id_aa64pfr0)) {
		val |= HCR_TERR | HCR_TEA;
		val &= ~(HCR_FIEN);
	}