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] fix xen panic on disabling a cpu

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix xen panic on disabling a cpu
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 18 Feb 2009 14:04:22 +0900
Delivery-date: Tue, 17 Feb 2009 21:04:55 -0800
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
When the dom0 is powered off, 

(XEN) Xen call trace:
(XEN)    [<ffff828c801479ad>] set_msi_affinity+0x90/0x1cb
(XEN)    [<ffff828c801437c0>] set_msi_affinity_vector+0x1b/0x1d
(XEN)    [<ffff828c80148876>] fixup_irqs+0xc7/0x1c3
(XEN)    [<ffff828c8015b182>] __cpu_disable+0x1bf/0x1e3
(XEN)    [<ffff828c8015b1af>] take_cpu_down+0x9/0xe
(XEN)    [<ffff828c8011b9f6>] stopmachine_softirq+0x5f/0x7a
(XEN)    [<ffff828c8011b251>] do_softirq+0x6a/0x77
(XEN)    [<ffff828c8013ba26>] idle_loop+0x9a/0x9c
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 1:
(XEN) Assertion '_spin_is_locked(&irq_desc[vector].lock)' failed at msi.c:289
(XEN) ****************************************

Also, fix a typo in a message. 'irq' => 'vector'

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 09a6fa059b37 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Feb 13 09:48:56 2009 +0000
+++ b/xen/arch/x86/irq.c        Wed Feb 18 12:00:31 2009 +0900
@@ -1142,6 +1142,8 @@ void fixup_irqs(cpumask_t map)
     static int warned;
     irq_guest_action_t *action;
     struct pending_eoi *peoi;
+    irq_desc_t         *desc;
+    unsigned long       flags;
 
     /* Direct all future interrupts away from this CPU. */
     for ( vector = 0; vector < NR_VECTORS; vector++ )
@@ -1150,18 +1152,24 @@ void fixup_irqs(cpumask_t map)
         if ( vector_to_irq(vector) == 2 )
             continue;
 
-        cpus_and(mask, irq_desc[vector].affinity, map);
+        desc = &irq_desc[vector];
+
+        spin_lock_irqsave(&desc->lock, flags);
+
+        cpus_and(mask, desc->affinity, map);
         if ( any_online_cpu(mask) == NR_CPUS )
         {
             printk("Breaking affinity for vector %u (irq %i)\n",
                    vector, vector_to_irq(vector));
             mask = map;
         }
-        if ( irq_desc[vector].handler->set_affinity )
-            irq_desc[vector].handler->set_affinity(vector, mask);
-        else if ( irq_desc[vector].action && !(warned++) )
-            printk("Cannot set affinity for irq %u (irq %i)\n",
+        if ( desc->handler->set_affinity )
+            desc->handler->set_affinity(vector, mask);
+        else if ( desc->action && !(warned++) )
+            printk("Cannot set affinity for vector %u (irq %i)\n",
                    vector, vector_to_irq(vector));
+
+        spin_unlock_irqrestore(&desc->lock, flags);
     }
 
     /* Service any interrupts that beat us in the re-direction race. */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix xen panic on disabling a cpu, Kouya Shimura <=