Commit 33d85a93 authored by Oliver Upton's avatar Oliver Upton

KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking

Marc reports that L1 VMs aren't booting with the NV series applied to
today's kvmarm/next. After bisecting the issue, it appears that
44241f34 ("KVM: arm64: nv: Use accessors for modifying ID
registers") is to blame.

Poking around at the issue a bit further, it'd appear that the value for
ID_AA64PFR0_EL1 is complete garbage, as 'val' still contains the value
we set ID_AA64ISAR1_EL1 to.

Fix the read-modify-write pattern to actually use ID_AA64PFR0_EL1 as the
starting point. Excuse me as I return to my shame cube.
Reported-by: default avatarMarc Zyngier <maz@kernel.org>
Fixes: 44241f34 ("KVM: arm64: nv: Use accessors for modifying ID registers")
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Tested-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240621224044.2465901-1-oliver.upton@linux.devSigned-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
parent 11a31be8
...@@ -40,7 +40,7 @@ static void limit_nv_id_regs(struct kvm *kvm) ...@@ -40,7 +40,7 @@ static void limit_nv_id_regs(struct kvm *kvm)
kvm_set_vm_id_reg(kvm, SYS_ID_AA64ISAR1_EL1, val); kvm_set_vm_id_reg(kvm, SYS_ID_AA64ISAR1_EL1, val);
/* No AMU, MPAM, S-EL2, RAS or SVE */ /* No AMU, MPAM, S-EL2, RAS or SVE */
kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1); val = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1);
val &= ~(GENMASK_ULL(55, 52) | val &= ~(GENMASK_ULL(55, 52) |
NV_FTR(PFR0, AMU) | NV_FTR(PFR0, AMU) |
NV_FTR(PFR0, MPAM) | NV_FTR(PFR0, MPAM) |
......
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