mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: nv: Don't WARN when L1 sets IMO and FMO differently
@ 2026-10-22 10:03 Fuad Tabba
  0 siblings, 0 replies; only message in thread
From: Fuad Tabba @ 2026-10-22 10:03 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm, linux-arm-kernel
  Cc: Joey Gouly, Suzuki K Poulose, Zenghui Yu, Steffen Eiden,
	Catalin Marinas, Will Deacon, Mark Rutland, Fuad Tabba,
	linux-kernel

When L1 runs L2 with only one of IMO and FMO set in its HCR_EL2,
vgic_state_is_nested() WARNs that this isn't supported. KVM then runs
L2 as if both bits were set.

However, IMO and FMO are independent bits, so any L1 can trigger the
WARN, which panics a host running with panic_on_warn.

Drop the WARN.

Fixes: 146a050f2d8c4 ("KVM: arm64: nv: Nested GICv3 emulation")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260714235020.2F4151F000E9@smtp.kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
I dropped the WARN rather than demoting it to a print, the same way
e6e3e0022ef8f ("KVM: arm64: timer: Drop warning on failed interrupt
signalling") dropped one that was loud and easy to trigger from
userspace.

Tested on QEMU with kvm-arm.mode=nested. A reproducer of mine sets
L1's HCR_EL2 to IMO=1, FMO=0, TGE=0 through KVM_SET_ONE_REG and starts
the vCPU at EL1. The host WARNs on the first KVM_RUN without this
patch, and not with it.

Based on kvmarm/fixes (c5b7894f1a26b), which has the HCR_EL2_* rename.

 arch/arm64/kvm/vgic/vgic-v3-nested.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm64/kvm/vgic/vgic-v3-nested.c b/arch/arm64/kvm/vgic/vgic-v3-nested.c
index 82bfc4d4f122f..c70e06c46a7a5 100644
--- a/arch/arm64/kvm/vgic/vgic-v3-nested.c
+++ b/arch/arm64/kvm/vgic/vgic-v3-nested.c
@@ -121,9 +121,6 @@ bool vgic_state_is_nested(struct kvm_vcpu *vcpu)
 
 	if (is_nested_ctxt(vcpu)) {
 		xmo = __vcpu_sys_reg(vcpu, HCR_EL2) & (HCR_EL2_IMO | HCR_EL2_FMO);
-		WARN_ONCE(xmo && xmo != (HCR_EL2_IMO | HCR_EL2_FMO),
-			  "Separate virtual IRQ/FIQ settings not supported\n");
-
 		return !!xmo;
 	}
 

base-commit: c5b7894f1a26b5cc942be1cd11b15c3876c837a1
-- 
2.47.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-22 10:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 10:03 [PATCH] KVM: arm64: nv: Don't WARN when L1 sets IMO and FMO differently Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®