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

[Xen-devel] [PATCH] fix xen panic on disabling a cpu



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

 


Rackspace

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