ia64/xen-unstable

changeset 18759:57c94bdbd6b3

[IA64] fix {un}lock_ipi_calllock().

Now _raw_spin_lock() checks whether interrupt is masked or not.
If masked, it panics.
lock_ipi_calllock() violates the assumption.
This patch make lock_ipi_calllock() use spin_lock_irqsave()
instead of spin_lock_irq().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Tue Nov 04 14:35:24 2008 +0900 (2008-11-04)
parents e75cb35c798b
children 958942c44332
files xen/arch/ia64/linux-xen/smp.c xen/arch/ia64/linux-xen/smpboot.c xen/include/asm-ia64/linux-xen/asm/smp.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/smp.c	Tue Nov 04 12:43:19 2008 +0900
     1.2 +++ b/xen/arch/ia64/linux-xen/smp.c	Tue Nov 04 14:35:24 2008 +0900
     1.3 @@ -101,6 +101,20 @@ static DEFINE_PER_CPU(u64, ipi_operation
     1.4  
     1.5  extern void cpu_halt (void);
     1.6  
     1.7 +#ifdef XEN
     1.8 +/* work around for spinlock irq check. */
     1.9 +void
    1.10 +lock_ipi_calllock(unsigned long *flags)
    1.11 +{
    1.12 +	spin_lock_irqsave(&call_lock, *flags);
    1.13 +}
    1.14 +
    1.15 +void
    1.16 +unlock_ipi_calllock(unsigned long flags)
    1.17 +{
    1.18 +	spin_unlock_irqrestore(&call_lock, flags);
    1.19 +}
    1.20 +#else
    1.21  void
    1.22  lock_ipi_calllock(void)
    1.23  {
    1.24 @@ -112,6 +126,7 @@ unlock_ipi_calllock(void)
    1.25  {
    1.26  	spin_unlock_irq(&call_lock);
    1.27  }
    1.28 +#endif
    1.29  
    1.30  static void
    1.31  stop_this_cpu (void)
     2.1 --- a/xen/arch/ia64/linux-xen/smpboot.c	Tue Nov 04 12:43:19 2008 +0900
     2.2 +++ b/xen/arch/ia64/linux-xen/smpboot.c	Tue Nov 04 14:35:24 2008 +0900
     2.3 @@ -364,6 +364,10 @@ smp_setup_percpu_timer (void)
     2.4  static void __devinit
     2.5  smp_callin (void)
     2.6  {
     2.7 +#ifdef XEN
     2.8 +	/* work around for spinlock irq assert. */
     2.9 +	unsigned long flags;
    2.10 +#endif
    2.11  	int cpuid, phys_id;
    2.12  	extern void ia64_init_itm(void);
    2.13  
    2.14 @@ -382,9 +386,17 @@ smp_callin (void)
    2.15  
    2.16  	fix_b0_for_bsp();
    2.17  
    2.18 +#ifdef XEN
    2.19 +	lock_ipi_calllock(&flags);
    2.20 +#else
    2.21  	lock_ipi_calllock();
    2.22 +#endif
    2.23  	cpu_set(cpuid, cpu_online_map);
    2.24 +#ifdef XEN
    2.25 +	unlock_ipi_calllock(flags);
    2.26 +#else
    2.27  	unlock_ipi_calllock();
    2.28 +#endif
    2.29  	per_cpu(cpu_state, cpuid) = CPU_ONLINE;
    2.30  
    2.31  	smp_setup_percpu_timer();
     3.1 --- a/xen/include/asm-ia64/linux-xen/asm/smp.h	Tue Nov 04 12:43:19 2008 +0900
     3.2 +++ b/xen/include/asm-ia64/linux-xen/asm/smp.h	Tue Nov 04 14:35:24 2008 +0900
     3.3 @@ -131,8 +131,13 @@ extern void smp_do_timer (struct pt_regs
     3.4  extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
     3.5  				     int retry, int wait);
     3.6  extern void smp_send_reschedule (int cpu);
     3.7 +#ifdef XEN
     3.8 +extern void lock_ipi_calllock(unsigned long *flags);
     3.9 +extern void unlock_ipi_calllock(unsigned long flags);
    3.10 +#else
    3.11  extern void lock_ipi_calllock(void);
    3.12  extern void unlock_ipi_calllock(void);
    3.13 +#endif
    3.14  extern void identify_siblings (struct cpuinfo_ia64 *);
    3.15  
    3.16  #else