# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1234947566 0
# Node ID b29a64d04a01647f70f2c921dbec0b6a3124b2bb
# Parent c3a307f5a14b2b10e8e34afcc1cf42fe3f2f2737
x86: Fix xen panic when offlining a CPU.
Also, fix a typo in a message. 'irq' => 'vector'
Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
xen/arch/x86/irq.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff -r c3a307f5a14b -r b29a64d04a01 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c Wed Feb 18 08:57:56 2009 +0000
+++ b/xen/arch/x86/irq.c Wed Feb 18 08:59:26 2009 +0000
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|