Skip to content

KVM: arm64: vgic-its: Fix LPI double mapping and DISCARD

Fuad Tabba kvmarm linux-arm-kernel lkml sashiko-reviews 1 version Applied

Status from this message: Applied to fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 14 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: vgic-its: Don't map an LPI from more than one eventarch/arm64/kvm/vgic/vgic-its.c include/kvm/arm_vgic.h+25 -20 replies
2/2KVM: arm64: vgic-its: Remove the pending state of a discarded LPIarch/arm64/kvm/vgic/vgic-its.c+19 -54 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchOliver Upton
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

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

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/[email protected]/

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

 arch/arm64/kvm/vgic/vgic-its.c | 50 +++++++++++++++++++++++++++++-----
 include/kvm/arm_vgic.h         |  1 +
 2 files changed, 44 insertions(+), 7 deletions(-)

base-commit: fd73f4a6659897191fa0d40695fe370925dd3780

Signature · 1 line
2.39.5