[PATCH v2] KVM: arm64: vgic: fix incorrect spinlock API usage

Alok Tiwari posted 1 patch 1 day, 3 hours ago
arch/arm64/kvm/vgic/vgic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] KVM: arm64: vgic: fix incorrect spinlock API usage
Posted by Alok Tiwari 1 day, 3 hours ago
The function vgic_flush_lr_state() is calling _raw_spin_unlock()
instead of the proper raw_spin_unlock().

_raw_spin_unlock() is an internal low-level API and should not
be used directly; using raw_spin_unlock() ensures proper locking
semantics in the vgic code.

Fixes: 8fa3adb8c6be ("KVM: arm/arm64: vgic: Make vgic_irq->irq_lock a raw_spinlock")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
v1 -> v2
Dropped extra paragraph and added Acked-by Marc
---
 arch/arm64/kvm/vgic/vgic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
index f5148b38120a..c74d6120a12c 100644
--- a/arch/arm64/kvm/vgic/vgic.c
+++ b/arch/arm64/kvm/vgic/vgic.c
@@ -818,7 +818,7 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu)
 		 * the AP list has been sorted already.
 		 */
 		if (multi_sgi && irq->priority > prio) {
-			_raw_spin_unlock(&irq->irq_lock);
+			raw_spin_unlock(&irq->irq_lock);
 			break;
 		}
 
-- 
2.50.1
Re: [PATCH v2] KVM: arm64: vgic: fix incorrect spinlock API usage
Posted by Oliver Upton 1 day, 3 hours ago
On Mon, 08 Sep 2025 11:04:11 -0700, Alok Tiwari wrote:
> The function vgic_flush_lr_state() is calling _raw_spin_unlock()
> instead of the proper raw_spin_unlock().
> 
> _raw_spin_unlock() is an internal low-level API and should not
> be used directly; using raw_spin_unlock() ensures proper locking
> semantics in the vgic code.
> 
> [...]

Applied to fixes, thanks!

[1/1] KVM: arm64: vgic: fix incorrect spinlock API usage
      https://git.kernel.org/kvmarm/kvmarm/c/2d0478279fc7

--
Best,
Oliver