ia64/xen-unstable

changeset 19229:b29a64d04a01

x86: Fix xen panic when offlining a CPU.

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

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 18 08:59:26 2009 +0000 (2009-02-18)
parents c3a307f5a14b
children 0c61a377c627
files xen/arch/x86/irq.c
line diff
     1.1 --- a/xen/arch/x86/irq.c	Wed Feb 18 08:57:56 2009 +0000
     1.2 +++ b/xen/arch/x86/irq.c	Wed Feb 18 08:59:26 2009 +0000
     1.3 @@ -1142,6 +1142,8 @@ void fixup_irqs(cpumask_t map)
     1.4      static int warned;
     1.5      irq_guest_action_t *action;
     1.6      struct pending_eoi *peoi;
     1.7 +    irq_desc_t         *desc;
     1.8 +    unsigned long       flags;
     1.9  
    1.10      /* Direct all future interrupts away from this CPU. */
    1.11      for ( vector = 0; vector < NR_VECTORS; vector++ )
    1.12 @@ -1150,18 +1152,24 @@ void fixup_irqs(cpumask_t map)
    1.13          if ( vector_to_irq(vector) == 2 )
    1.14              continue;
    1.15  
    1.16 -        cpus_and(mask, irq_desc[vector].affinity, map);
    1.17 +        desc = &irq_desc[vector];
    1.18 +
    1.19 +        spin_lock_irqsave(&desc->lock, flags);
    1.20 +
    1.21 +        cpus_and(mask, desc->affinity, map);
    1.22          if ( any_online_cpu(mask) == NR_CPUS )
    1.23          {
    1.24              printk("Breaking affinity for vector %u (irq %i)\n",
    1.25                     vector, vector_to_irq(vector));
    1.26              mask = map;
    1.27          }
    1.28 -        if ( irq_desc[vector].handler->set_affinity )
    1.29 -            irq_desc[vector].handler->set_affinity(vector, mask);
    1.30 -        else if ( irq_desc[vector].action && !(warned++) )
    1.31 -            printk("Cannot set affinity for irq %u (irq %i)\n",
    1.32 +        if ( desc->handler->set_affinity )
    1.33 +            desc->handler->set_affinity(vector, mask);
    1.34 +        else if ( desc->action && !(warned++) )
    1.35 +            printk("Cannot set affinity for vector %u (irq %i)\n",
    1.36                     vector, vector_to_irq(vector));
    1.37 +
    1.38 +        spin_unlock_irqrestore(&desc->lock, flags);
    1.39      }
    1.40  
    1.41      /* Service any interrupts that beat us in the re-direction race. */