]> Gentwo Git Trees - linux/.git/commit
KVM: arm64: vgic-v3: Reinstate IRQ lock ordering for LPI xarray
authorOliver Upton <oupton@kernel.org>
Fri, 7 Nov 2025 18:48:46 +0000 (10:48 -0800)
committerMarc Zyngier <maz@kernel.org>
Sat, 8 Nov 2025 11:19:32 +0000 (11:19 +0000)
commit75360a9a338580990c1ee188d40a838c025bbd30
tree7aae4dc636ee0a70ecf2ed2bef6e9905739ce28a
parent50e7cce81b9b2fbd6f0104c1698959d45ce3cf58
KVM: arm64: vgic-v3: Reinstate IRQ lock ordering for LPI xarray

Zenghui reports that running a KVM guest with an assigned device and
lockdep enabled produces an unfriendly splat due to an inconsistent irq
context when taking the lpi_xa's spinlock.

This is no good as in rare cases the last reference to an LPI can get
dropped after injection of a cached LPI translation. In this case,
vgic_put_irq() will release the IRQ struct and take the lpi_xa's
spinlock to erase it from the xarray.

Reinstate the IRQ ordering and update the lockdep hint accordingly. Note
that there is no irqsave equivalent of might_lock(), so just explictly
grab and release the spinlock on lockdep kernels.

Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Closes: https://lore.kernel.org/kvmarm/b4d7cb0f-f007-0b81-46d1-998b15cc14bc@huawei.com/
Fixes: 982f31bbb5b0 ("KVM: arm64: vgic-v3: Don't require IRQs be disabled for LPI xarray lock")
Signed-off-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/20251107184847.1784820-2-oupton@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/vgic/vgic-debug.c
arch/arm64/kvm/vgic/vgic-init.c
arch/arm64/kvm/vgic/vgic-its.c
arch/arm64/kvm/vgic/vgic.c