mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: arm64: vgic-v4: Don't allocate vPEs that a VM can't use
@ 2026-10-26 15:26 Fuad Tabba
  2026-10-26 15:26 ` [PATCH 1/2] KVM: arm64: vgic-v4: Don't allocate vPEs for a GICv2 VM Fuad Tabba
  2026-10-26 15:26 ` [PATCH 2/2] KVM: arm64: vgic-v4: Don't allocate vPEs when userspace clears nASSGIcap Fuad Tabba
  0 siblings, 2 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-10-26 15:26 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
	Raghavendra Rao Ananta, Eric Auger, Will Deacon, Fuad Tabba,
	kvmarm, linux-arm-kernel, linux-kernel

Hi folks,

Two fixes for vgic_its_create() allocating vPEs for a VM that never
uses them. Nothing frees them when the VM is destroyed, and each
doorbell handler stays registered with a freed vCPU.

The first is for a GICv2 VM, which KVM can run on a GICv4.0 host whose
CPU interface supports legacy operation. The second is for a GICv3 VM
whose VMM cleared nASSGIcap on a GICv4.1 host with vSGIs.

Tested on AEM FVP, with has-gicv4.1=0 for the GICv2 case and =1 for the
other. With my reproducer (clear nASSGIcap for the second case,
initialise the vgic, create an ITS, destroy the VM), the kernel without
the fix leaves four "vcpu" doorbells in /proc/interrupts in each case,
and the fixed one doesn't leave any.

It doesn't conflict with my vgic init error-path series [1].

Based on Linux 7.3-rc3 (fd73f4a665989; also applies to kvmarm-7.4).

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260921072958.2918477-1-fuad.tabba@linux.dev/

Fuad Tabba (2):
  KVM: arm64: vgic-v4: Don't allocate vPEs for a GICv2 VM
  KVM: arm64: vgic-v4: Don't allocate vPEs when userspace clears
    nASSGIcap

 arch/arm64/kvm/vgic/vgic-v4.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
-- 
2.47.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-27  7:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 15:26 [PATCH 0/2] KVM: arm64: vgic-v4: Don't allocate vPEs that a VM can't use Fuad Tabba
2026-10-26 15:26 ` [PATCH 1/2] KVM: arm64: vgic-v4: Don't allocate vPEs for a GICv2 VM Fuad Tabba
2026-10-26 19:12   ` Oliver Upton
2026-10-26 19:55     ` Marc Zyngier
2026-10-26 21:30       ` Oliver Upton
2026-10-27  7:37         ` Fuad Tabba
2026-10-26 15:26 ` [PATCH 2/2] KVM: arm64: vgic-v4: Don't allocate vPEs when userspace clears nASSGIcap Fuad Tabba
2026-10-26 19:39   ` Oliver Upton
2026-10-27  7:36     ` Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®