[PATCH 0/3] KVM: arm64: vgic: Drop stale LPI pending state

From: Fuad Tabba

Date: Thu Nov 05 2026 - 06:03:46 EST


Hi folks,

The GIC just keeps on giving. Three follow-ups to my LPI fixes for
redistributors with LPIs disabled [1], to fix pre-existing bugs Sashiko
found.

The first drops the pending state of every LPI targeting a
redistributor when the guest disables its LPIs, not just of those on
the AP list, so a re-enable with GICR_PENDBASER.PTZ set doesn't bring
any of them back. Linux never sets PTZ.

The second stops the pending-table save from writing to the table of a
redistributor while its LPIs are disabled.

The third stops KVM reading the pending table when mapping an LPI, so
that mapping a discarded LPI's INTID again doesn't make it pending a
second time. A Linux guest can hit that after its VMM pauses and
resumes it. It also drops the copy that patch 2 of [1] takes, which is
why it comes after the second. An LPI mapped after its redistributor
enabled LPIs no longer takes a bit the guest wrote into the table
before the enable. Keeping that needs a per-redistributor record of
the pending state of unmapped INTIDs. I can add it on top if you think
it's worth it.

A pending LPI that MOVI moves onto a redistributor with LPIs disabled,
or that a device signals there through a translation cached before the
move, can still be taken once after a PTZ-set enable. The architecture
lets KVM drop it, but that's pending state moved or raised onto a
redistributor with LPIs disabled, not state the guest gave up. I've
left it alone, but can fix it on top if you think it's worth it.

Reproducers for all three fail on kvmarm/fixes and pass with the
series. I'll fold them into vgic_lpi_stress separately.

Based on kvmarm/fixes (181a701fc14d3), which has [1].

Cheers,
/fuad

[1] https://lore.kernel.org/all/20261026092802.2636798-1-fuad.tabba@xxxxxxxxx/

Fuad Tabba (3):
KVM: arm64: vgic: Drop the pending state of all LPIs when disabling
LPIs
KVM: arm64: vgic-v3: Don't save pending tables with LPIs disabled
KVM: arm64: vgic-its: Don't read the pending table when mapping an LPI

.../virt/kvm/devices/arm-vgic-v3.rst | 1 +
arch/arm64/kvm/vgic/vgic-its.c | 33 ++++++++----
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 13 ++---
arch/arm64/kvm/vgic/vgic-v3.c | 50 ++-----------------
arch/arm64/kvm/vgic/vgic.c | 16 +++++-
arch/arm64/kvm/vgic/vgic.h | 1 -
6 files changed, 49 insertions(+), 65 deletions(-)


base-commit: 181a701fc14d3d468c603b5ecfb9f12115c5fb72
--
2.47.3