]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
KVM: arm64: vgic-v3: Indicate vgic_put_irq() may take LPI xarray lock
authorOliver Upton <oliver.upton@linux.dev>
Fri, 5 Sep 2025 10:05:31 +0000 (03:05 -0700)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 10 Sep 2025 09:56:20 +0000 (02:56 -0700)
The release path on LPIs is quite rare, meaning it can be difficult to
find lock ordering bugs on the LPI xarray's spinlock. Tell lockdep that
vgic_put_irq() might acquire the xa_lock to make unsafe patterns more
obvious.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250905100531.282980-7-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/vgic/vgic.c

index a21b482844ce845ab91413a4d146e91b7f63c1d1..3b247041a1300c842a109da4ecec3f398c2cc459 100644 (file)
@@ -142,6 +142,9 @@ void vgic_put_irq(struct kvm *kvm, struct vgic_irq *irq)
 {
        struct vgic_dist *dist = &kvm->arch.vgic;
 
+       if (irq->intid >= VGIC_MIN_LPI)
+               might_lock(&dist->lpi_xa.xa_lock);
+
        if (!__vgic_put_irq(kvm, irq))
                return;