* [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR
@ 2026-08-10 10:29 Kajetan Puchalski
2026-08-10 11:32 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Kajetan Puchalski @ 2026-08-10 10:29 UTC (permalink / raw)
To: maz, oupton, fuad.tabba, joey.gouly, seiden, suzuki.poulose,
yuzenghui, catalin.marinas, will, jic23, Sascha.Bischoff
Cc: linux-arm-kernel, kvmarm, stable, linux-kernel
As per the ARM GICv3 spec, the maintenance interrupt identified by
ICH_MISR_EL2.NP is asserted when it is enabled and no List register is
in pending state. This is further described in the document as "no List
registers with the State field set to 0b01 (pending)". By checking only
the pending bit of the LR (bit 62), KVM currently asserts the MI when
there are no LRs in "pending" or "pending and active" states.
Fix the detection logic to consider only the "pending" state.
Cc: stable@vger.kernel.org
Fixes: 96c2f03311de ("KVM: arm64: nv: Plumb handling of GICv3 EL2 accesses")
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
---
arch/arm64/kvm/vgic/vgic-v3-nested.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/vgic/vgic-v3-nested.c b/arch/arm64/kvm/vgic/vgic-v3-nested.c
index 5c69fa615823..e3e84d7f5ad5 100644
--- a/arch/arm64/kvm/vgic/vgic-v3-nested.c
+++ b/arch/arm64/kvm/vgic/vgic-v3-nested.c
@@ -152,7 +152,7 @@ static void vgic_compute_mi_state(struct kvm_vcpu *vcpu, struct mi_state *mi_sta
eisr |= BIT(i);
if (!(lr & ICH_LR_STATE))
elrsr |= BIT(i);
- pend |= (lr & ICH_LR_PENDING_BIT);
+ pend |= (lr & ICH_LR_STATE) == ICH_LR_PENDING_BIT;
}
mi_state->eisr = eisr;
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR
2026-08-10 10:29 [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR Kajetan Puchalski
@ 2026-08-10 11:32 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2026-08-10 11:32 UTC (permalink / raw)
To: Kajetan Puchalski
Cc: oupton, fuad.tabba, joey.gouly, seiden, suzuki.poulose, yuzenghui,
catalin.marinas, will, jic23, Sascha.Bischoff, zenghui.yu,
linux-arm-kernel, kvmarm, stable, linux-kernel
[Fixing up the initial recipient list...]
On Mon, 10 Aug 2026 11:29:24 +0100,
Kajetan Puchalski <kajetan.puchalski@arm.com> wrote:
>
> As per the ARM GICv3 spec, the maintenance interrupt identified by
> ICH_MISR_EL2.NP is asserted when it is enabled and no List register is
> in pending state. This is further described in the document as "no List
> registers with the State field set to 0b01 (pending)". By checking only
> the pending bit of the LR (bit 62), KVM currently asserts the MI when
> there are no LRs in "pending" or "pending and active" states.
> Fix the detection logic to consider only the "pending" state.
>
> Cc: stable@vger.kernel.org
> Fixes: 96c2f03311de ("KVM: arm64: nv: Plumb handling of GICv3 EL2 accesses")
> Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
> ---
> arch/arm64/kvm/vgic/vgic-v3-nested.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/vgic/vgic-v3-nested.c b/arch/arm64/kvm/vgic/vgic-v3-nested.c
> index 5c69fa615823..e3e84d7f5ad5 100644
> --- a/arch/arm64/kvm/vgic/vgic-v3-nested.c
> +++ b/arch/arm64/kvm/vgic/vgic-v3-nested.c
> @@ -152,7 +152,7 @@ static void vgic_compute_mi_state(struct kvm_vcpu *vcpu, struct mi_state *mi_sta
> eisr |= BIT(i);
> if (!(lr & ICH_LR_STATE))
> elrsr |= BIT(i);
> - pend |= (lr & ICH_LR_PENDING_BIT);
> + pend |= (lr & ICH_LR_STATE) == ICH_LR_PENDING_BIT;
> }
>
> mi_state->eisr = eisr;
Thanks for catching this.
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-10 11:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 10:29 [PATCH] KVM: arm64: vgic: Fix detection of MI on no pending LR Kajetan Puchalski
2026-08-10 11:32 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox