WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86: adjust pirq_spin_lock_irq_desc()

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: adjust pirq_spin_lock_irq_desc()
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 01 Jul 2011 11:35:55 +0100
Cc: christoph.egger@xxxxxxx
Delivery-date: Fri, 01 Jul 2011 03:36:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Remove unnecessary/bogus assertions and add retry loop matching
domain_spin_lock_irq_desc().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -952,30 +952,31 @@ struct irq_desc *domain_spin_lock_irq_de
 }
 
 /*
- * Same with struct pirq already looked up, and d->event_lock already
- * held (thus the PIRQ <-> IRQ mapping can't change under our feet).
+ * Same with struct pirq already looked up.
  */
 struct irq_desc *pirq_spin_lock_irq_desc(
     struct domain *d, const struct pirq *pirq, unsigned long *pflags)
 {
-    int irq = pirq->arch.irq;
     struct irq_desc *desc;
     unsigned long flags;
 
-    ASSERT(spin_is_locked(&d->event_lock));
+    for ( ; ; )
+    {
+        int irq = pirq->arch.irq;
 
-    if ( irq <= 0 )
-        return NULL;
+        if ( irq <= 0 )
+            return NULL;
 
-    desc = irq_to_desc(irq);
-    spin_lock_irqsave(&desc->lock, flags);
+        desc = irq_to_desc(irq);
+        spin_lock_irqsave(&desc->lock, flags);
+        if ( irq == pirq->arch.irq )
+            break;
+        spin_unlock_irqrestore(&desc->lock, flags);
+    }
 
     if ( pflags )
         *pflags = flags;
 
-    ASSERT(pirq == pirq_info(d, domain_irq_to_pirq(d, irq)));
-    ASSERT(irq == pirq->arch.irq);
-
     return desc;
 }
 



Attachment: x86-pirq-irq-assertion.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: adjust pirq_spin_lock_irq_desc(), Jan Beulich <=