Skip to content

KVM: arm64: vgic: Stop migrating IRQ from vgic_prune_ap_list()

Oliver Upton kvmarm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: arm64: Add helpers to halt a vCPUarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c+16 -41 reply
2/4KVM: arm64: vgic: Move IRQ migrations out of vgic_prune_ap_list()arch/arm64/kvm/vgic/vgic-its.c arch/arm64/kvm/vgic/vgic-mmio-v2.c arch/arm64/kvm/vgic/vgic-mmio-v3.c +3 more+139 -1002 replies
3/4KVM: arm64: vgic-v3: Only pause the targeted vCPU when disabling LPIsarch/arm64/kvm/vgic/vgic-mmio-v3.c+4 -40 replies
4/4KVM: arm64: vgic-v3: Pause the source vCPU when processing MOVALL cmdarch/arm64/kvm/vgic/vgic-its.c+5 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: arm64: vgic: Stop migrating IRQ from vgic_prune_ap_list()

The VGIC has been getting a lot of undesired attention lately, as there's plenty of weird and wonderful ways that the guest can play games with KVM. My general impression on the whole matter is that modifying AP lists remotely is a giant mess, with the worst offender being vgic_prune_ap_list().

This series aims to sidestep the issue by only recalling IRQs from an AP list if the vCPU has been paused. Keeping the overheads reasonable also means adding support for pausing a single vCPU instead of the entire VM, so update the eligible users of kvm_arm_halt_guest() to something more relaxed while we're at it.

Marc, this series applies on top of your own for LPI malice [1]. You'll note that I've taken some of it for 7.3 while leaving the rest for you to take in 7.4, I'm perfectly happy with Patch 3 and 4 getting squashed into the corresponding bits of your own series if you prefer.

Tested semi-rigorously on an Altra machine and the Orion board, using both real guests and an LLM-generated selftest specific for migrating pending LPIs. The latter was way too big to make sense of, I'll try and post a test if I can it into something tidy.

[1]: https://lore.kernel.org/kvmarm/[email protected]/

Oliver Upton (4):
KVM: arm64: Add helpers to halt a vCPU
KVM: arm64: vgic: Move IRQ migrations out of vgic_prune_ap_list()
KVM: arm64: vgic-v3: Only pause the targeted vCPU when disabling LPIs
KVM: arm64: vgic-v3: Pause the source vCPU when processing MOVALL cmd

 arch/arm64/include/asm/kvm_host.h  |   2 +
 arch/arm64/kvm/arm.c               |  18 ++-
 arch/arm64/kvm/vgic/vgic-its.c     |  19 ++-
 arch/arm64/kvm/vgic/vgic-mmio-v2.c |  11 +-
 arch/arm64/kvm/vgic/vgic-mmio-v3.c |  18 ++-
 arch/arm64/kvm/vgic/vgic.c         | 184 +++++++++++++++++------------
 arch/arm64/kvm/vgic/vgic.h         |  24 ++++
 include/kvm/arm_vgic.h             |   1 +
 8 files changed, 164 insertions(+), 113 deletions(-)

base-commit: cfaf3b76669d386912a91103671691692f81c316

Signature · 1 line
2.47.3