Re: [PATCH v4 08/48] KVM: arm64: gic-v5: Add VPE doorbell domain

Sascha Bischoff <[email protected]> Fri, 31 Jul 2026 09:33:07 +0000
Newsgroups dev.linux.lists.sashiko-reviews,dev.linux.lists.kvmarm,org.kernel.vger.kvm
Message-ID <[email protected]>
On Fri, 2026-07-24 at 11:11 +0000, [email protected] wrote:
> > +static void vgic_v5_teardown_per_vm_domain(struct vgic_v5_vm *vm)
> > +{
> > +	if (!vm->domain)
> > +		return;
> > +
> 
> [Severity: High]
> Does this code leak the allocated doorbell IRQs and their request
> handlers?
> 
> During initialization, vgic_v5_create_per_vm_domain() allocates IRQs
> via
> irq_domain_alloc_irqs(), and vgic_v5_init() requests them via
> request_irq().
> 
> Should free_irq() and irq_domain_free_irqs() be called before tearing
> down the domain? 

Yes, it should do irq_domain_free_irqs(). It was missing in this
commit, but is handled in a future commit. I've updated this commit to
call irq_domain_free_irqs().

> Removing a domain that still has allocated IRQs can trigger a
> warning in the core IRQ subsystem, and repeatedly creating and
> destroying
> VMs could eventually exhaust the IRQ descriptor space.

Thanks,
Sascha