[PATCH v2 0/2] KVM: arm64: vgic-its: Fix LPI double mapping and DISCARD

Marc Zyngier maz at kernel.org
Tue Oct 13 03:01:44 PDT 2026


On Tue, 13 Oct 2026 10:51:48 +0100,
Oliver Upton <oupton at kernel.org> wrote:
> 
> On Tue, Oct 13, 2026 at 09:16:44AM +0100, Fuad Tabba wrote:
> > Hi folks,
> > 
> > Changes since v1 [1]:
> >   - Dropped the second mapping of an LPI at MAPTI, instead of keeping a
> >     doubly mapped LPI out of GICv4 forwarding. (Marc)
> >   - Keyed that check on whether an ITE maps the LPI, not on whether its
> >     vgic_irq exists.
> >   - Added a patch that makes DISCARD remove the pending state. (Marc)
> > 
> > Two fixes to the ITS emulation. The first stops a guest from mapping
> > one LPI from two events, which can oops a GICv4 host when the VMM then
> > routes an assigned device's MSI to the second event. The second makes
> > DISCARD remove the LPI's pending state, as the spec requires.
> > 
> > Tested on QEMU, which emulates a GICv4 ITS. A local reproducer with two
> > vCPUs DISCARDs an LPI that's pending in the other vCPU's list register.
> > On rc3, and with patch 2 but without its halt, the guest still takes
> > the LPI. With the series applied, it doesn't.
> > 
> > Based on Linux 7.3-rc3 (fd73f4a665989).
> > 
> > Cheers,
> > /fuad
> > 
> > [1] https://lore.kernel.org/all/20261012084743.2228612-1-fuad.tabba@linux.dev/
> > 
> > Fuad Tabba (2):
> >   KVM: arm64: vgic-its: Don't map an LPI from more than one event
> >   KVM: arm64: vgic-its: Remove the pending state of a discarded LPI
> 
> Looks good. As all of these VGIC fixes depend on reliably synchronizing
> hwstate I'll assume Marc will apply this patchset after his own series.

Yeah, I now have a series that has the counting pause, your single
vcpu pause (fixed to DTRT), and the LPI disabling fix. Patch #2 of
this series can probably make use of the single-vcpu stunning.

As for the OUTSIDE_GUEST discussion, I've had a long discussion with
Will where we reversed engineered the synchronisation requirements,
and concluded that there was nothing to fix on that front (the logic
is incredibly subtle and counter-intuitive, but overall sound). This
patch is therefore dropped.

I'll post that today, and we can assemble a series.

Thanks,

	M.

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



More information about the linux-arm-kernel mailing list