]> www.infradead.org Git - linux.git/commitdiff
KVM: arm64: vgic: fix unexpected unlock sparse warnings
authorSebastian Ott <sebott@redhat.com>
Tue, 23 Jul 2024 10:12:04 +0000 (12:12 +0200)
committerOliver Upton <oliver.upton@linux.dev>
Fri, 2 Aug 2024 18:58:03 +0000 (18:58 +0000)
Get rid of unexpected unlock sparse warnings in vgic code
by adding an annotation to vgic_queue_irq_unlock().

arch/arm64/kvm/vgic/vgic.c:334:17: warning: context imbalance in 'vgic_queue_irq_unlock' - unexpected unlock
arch/arm64/kvm/vgic/vgic.c:419:5: warning: context imbalance in 'kvm_vgic_inject_irq' - different lock contexts for basic block

Signed-off-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240723101204.7356-4-sebott@redhat.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/vgic/vgic.c
arch/arm64/kvm/vgic/vgic.h

index f07b3ddff7d442be815ad15f3462d5539c84e76b..974849ea7101c6000159727a7c0077ccead78136 100644 (file)
@@ -313,7 +313,7 @@ static bool vgic_validate_injection(struct vgic_irq *irq, bool level, void *owne
  * with all locks dropped.
  */
 bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq,
-                          unsigned long flags)
+                          unsigned long flags) __releases(&irq->irq_lock)
 {
        struct kvm_vcpu *vcpu;
 
index 03d356a123771fda53c9aff25e475cbb68079bc6..ba8f790431bd3a8b34745f5679cbd587a2666440 100644 (file)
@@ -186,7 +186,7 @@ bool vgic_get_phys_line_level(struct vgic_irq *irq);
 void vgic_irq_set_phys_pending(struct vgic_irq *irq, bool pending);
 void vgic_irq_set_phys_active(struct vgic_irq *irq, bool active);
 bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq,
-                          unsigned long flags);
+                          unsigned long flags) __releases(&irq->irq_lock);
 void vgic_kick_vcpus(struct kvm *kvm);
 void vgic_irq_handle_resampling(struct vgic_irq *irq,
                                bool lr_deactivated, bool lr_pending);