All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking
@ 2024-06-21 22:40 Oliver Upton
  2024-06-22  8:35 ` Marc Zyngier
  2024-06-22 18:11 ` Oliver Upton
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Upton @ 2024-06-21 22:40 UTC (permalink / raw)
  To: kvmarm
  Cc: Marc Zyngier, James Morse, Suzuki K Poulose, Zenghui Yu, kvm,
	Oliver Upton

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
44241f34fac9 ("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: Marc Zyngier <maz@kernel.org>
Fixes: 44241f34fac9 ("KVM: arm64: nv: Use accessors for modifying ID registers")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
 arch/arm64/kvm/nested.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index f02089d98445..96029a95d106 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -815,7 +815,7 @@ static void limit_nv_id_regs(struct kvm *kvm)
 	kvm_set_vm_id_reg(kvm, SYS_ID_AA64ISAR1_EL1, val);
 
 	/* No AMU, MPAM, S-EL2, or RAS */
-	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)	|
 		 NV_FTR(PFR0, AMU)	|
 		 NV_FTR(PFR0, MPAM)	|

base-commit: a9e3d7734719d5b58f260edc15dce3ea4dc3d313
-- 
2.45.2.741.gdbec12cfda-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking
  2024-06-21 22:40 [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking Oliver Upton
@ 2024-06-22  8:35 ` Marc Zyngier
  2024-06-22 18:11 ` Oliver Upton
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2024-06-22  8:35 UTC (permalink / raw)
  To: Oliver Upton; +Cc: kvmarm, James Morse, Suzuki K Poulose, Zenghui Yu, kvm

On Fri, 21 Jun 2024 23:40:44 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> 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
> 44241f34fac9 ("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: Marc Zyngier <maz@kernel.org>
> Fixes: 44241f34fac9 ("KVM: arm64: nv: Use accessors for modifying ID registers")
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

Confirmed, we're back in business.

Acked-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking
  2024-06-21 22:40 [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking Oliver Upton
  2024-06-22  8:35 ` Marc Zyngier
@ 2024-06-22 18:11 ` Oliver Upton
  1 sibling, 0 replies; 3+ messages in thread
From: Oliver Upton @ 2024-06-22 18:11 UTC (permalink / raw)
  To: Oliver Upton, kvmarm
  Cc: Zenghui Yu, James Morse, Suzuki K Poulose, Marc Zyngier, kvm

On Fri, 21 Jun 2024 22:40:44 +0000, Oliver Upton wrote:
> 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
> 44241f34fac9 ("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.
> 
> [...]

Applied to kvmarm/next, thanks!

[1/1] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking
      https://git.kernel.org/kvmarm/kvmarm/c/33d85a93c6c3

--
Best,
Oliver

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-22 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21 22:40 [PATCH] KVM: arm64: nv: Unfudge ID_AA64PFR0_EL1 masking Oliver Upton
2024-06-22  8:35 ` Marc Zyngier
2024-06-22 18:11 ` Oliver Upton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.