[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC v2 06/16] vgic: move pause_flags check out of vgic spinlock



From: Andrii Anisov <andrii_anisov@xxxxxxxx>

Pause_flags is not related to vgic spinlock, so reduce code
under lock.

Signed-off-by: Andrii Anisov <andrii_anisov@xxxxxxxx>
---

Comments from Julien [1] are not addressed yet.

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03306.html

---
 xen/arch/arm/vgic.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 057a721..a795b6f 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -582,6 +582,12 @@ void vgic_inject_irq(struct domain *d, struct vcpu *v, 
unsigned int virq,
         v = vgic_get_target_vcpu(d->vcpu[0], virq);
     };
 
+    /* vcpu offline */
+    if ( unlikely(test_bit(_VPF_down, &v->pause_flags)) )
+    {
+        return;
+    }
+
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
     n = irq_to_pending(v, virq);
@@ -594,13 +600,6 @@ void vgic_inject_irq(struct domain *d, struct vcpu *v, 
unsigned int virq,
     }
 #endif
 
-    /* vcpu offline */
-    if ( test_bit(_VPF_down, &v->pause_flags) )
-    {
-        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
-        return;
-    }
-
     set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
 
     if ( !list_empty(&n->inflight) )
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.