KVM: arm64: vgic: Drop stale LPI pending state
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: arm64: vgic: Drop the pending state of all LPIs when disabling LPIsarch/ arch/ | +22 | 0 replies | |
| 2/3 | KVM: arm64: vgic-v3: Don't save pending tables with LPIs disabledDocumentation/ arch/ | +4 | 0 replies | |
| 3/3 | KVM: arm64: vgic-its: Don't read the pending table when mapping an LPIarch/ arch/ arch/ | +23 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] KVM: arm64: vgic: Drop stale LPI pending state
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/[email protected]/
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
Signature · 1 line
2.47.3