ia64/xen-unstable

changeset 8808:0a404794aac1

Fix CPU hotplug.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Feb 09 14:52:40 2006 +0100 (2006-02-09)
parents 10d6c1dc1bc7
children 3bbff714df11
files linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Thu Feb 09 12:17:35 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Thu Feb 09 14:52:40 2006 +0100
     1.3 @@ -124,10 +124,18 @@ EXPORT_SYMBOL(default_idle);
     1.4  #endif
     1.5  
     1.6  #ifdef CONFIG_HOTPLUG_CPU
     1.7 +extern cpumask_t cpu_initialized;
     1.8  static inline void play_dead(void)
     1.9  {
    1.10  	idle_task_exit();
    1.11 +	local_irq_disable();
    1.12 +	cpu_clear(smp_processor_id(), cpu_initialized);
    1.13 +	preempt_enable_no_resched();
    1.14  	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
    1.15 +	/* Same as drivers/xen/core/smpboot.c:cpu_bringup(). */
    1.16 +	cpu_init();
    1.17 +	touch_softlockup_watchdog();
    1.18 +	preempt_disable();
    1.19  	local_irq_enable();
    1.20  }
    1.21  #else
     2.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Thu Feb 09 12:17:35 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Thu Feb 09 14:52:40 2006 +0100
     2.3 @@ -138,14 +138,17 @@ void xen_idle(void)
     2.4  }
     2.5  
     2.6  #ifdef CONFIG_HOTPLUG_CPU
     2.7 -DECLARE_PER_CPU(int, cpu_state);
     2.8 -
     2.9 -#include <asm/nmi.h>
    2.10 -/* We halt the CPU with physical CPU hotplug */
    2.11  static inline void play_dead(void)
    2.12  {
    2.13  	idle_task_exit();
    2.14 +	local_irq_disable();
    2.15 +	cpu_clear(smp_processor_id(), cpu_initialized);
    2.16 +	preempt_enable_no_resched();
    2.17  	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
    2.18 +	/* Same as drivers/xen/core/smpboot.c:cpu_bringup(). */
    2.19 +	cpu_init();
    2.20 +	touch_softlockup_watchdog();
    2.21 +	preempt_disable();
    2.22  	local_irq_enable();
    2.23  }
    2.24  #else
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Thu Feb 09 12:17:35 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Thu Feb 09 14:52:40 2006 +0100
     3.3 @@ -40,8 +40,6 @@ extern void failsafe_callback(void);
     3.4  extern void system_call(void);
     3.5  extern void smp_trap_init(trap_info_t *);
     3.6  
     3.7 -extern cpumask_t cpu_initialized;
     3.8 -
     3.9  /* Number of siblings per CPU package */
    3.10  int smp_num_siblings = 1;
    3.11  int phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
    3.12 @@ -141,10 +139,9 @@ static void xen_smp_intr_exit(unsigned i
    3.13  
    3.14  static void cpu_bringup(void)
    3.15  {
    3.16 -	if (!cpu_isset(smp_processor_id(), cpu_initialized)) {
    3.17 -		cpu_init();
    3.18 -		preempt_disable();
    3.19 -	}
    3.20 +	cpu_init();
    3.21 +	touch_softlockup_watchdog();
    3.22 +	preempt_disable();
    3.23  	local_irq_enable();
    3.24  	cpu_idle();
    3.25  }