Skip to content

Commit 9df9186

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
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: 2a0c343 ("KVM: arm64: Initialize trap registers for protected VMs") Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 7ba5b8f commit 9df9186

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/arm64/kvm/hyp/nvhe/pkvm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ static void pvm_init_traps_hcr(struct kvm_vcpu *vcpu)
7070
*/
7171
val |= HCR_TACR | HCR_TIDCP | HCR_TID3 | HCR_TID1;
7272

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

0 commit comments

Comments
 (0)