diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-11 17:48:10 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-11 17:48:10 +0100 |
commit | d53485d69b6d328366038cfad8e9e90f66bdb317 (patch) | |
tree | d92cce8ad45ef5062e812595437fd46679b85728 /xen/include/asm-x86/smp.h | |
parent | 74eb7bf176e6cb5d109ee5b0f617bc7d6c71abc3 (diff) | |
download | xen-d53485d69b6d328366038cfad8e9e90f66bdb317.tar.gz xen-d53485d69b6d328366038cfad8e9e90f66bdb317.tar.bz2 xen-d53485d69b6d328366038cfad8e9e90f66bdb317.zip |
Provide cpu hotplug support to Xen. Note this hotplug
support is specific to PM, instead of for a run-time
single CPU hotplug which can be a separate task. See
embedded comment:
/*
* XXX: One important thing missed here is to migrate vcpus
* from dead cpu to other online ones and then put whole
* system into a stop state. It assures a safe environment
* for a cpu hotplug/remove at normal running state.
*
* However for xen PM case, at this point:
* -> All other domains should be notified with PM event,
* and then in following states:
* * Suspend state, or
* * Paused state, which is a force step to all
* domains if they do nothing to suspend
* -> All vcpus of dom0 (except vcpu0) have already beem
* hot removed
* with the net effect that all other cpus only have idle vcpu
* running. In this special case, we can avoid vcpu migration
* then and system can be considered in a stop state.
*
* So current cpu hotplug is a special version for PM specific
* usage, and need more effort later for full cpu hotplug.
* (ktian1)
*/
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/smp.h')
-rw-r--r-- | xen/include/asm-x86/smp.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h index f23b915873..83a48f3ea1 100644 --- a/xen/include/asm-x86/smp.h +++ b/xen/include/asm-x86/smp.h @@ -50,9 +50,22 @@ extern u8 x86_cpu_to_apicid[]; #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] +/* State of each CPU. */ +#define CPU_ONLINE 0x0002 /* CPU is up */ +#define CPU_DYING 0x0003 /* CPU is requested to die */ +#define CPU_DEAD 0x0004 /* CPU is dead */ +DECLARE_PER_CPU(int, cpu_state); + #ifdef CONFIG_HOTPLUG_CPU +#define cpu_is_offline(cpu) unlikely(per_cpu(cpu_state,cpu) == CPU_DYING) +extern int cpu_down(unsigned int cpu); +extern int cpu_up(unsigned int cpu); extern void cpu_exit_clear(void); extern void cpu_uninit(void); +extern void disable_nonboot_cpus(void); +extern void enable_nonboot_cpus(void); +#else +static inline int cpu_is_offline(int cpu) {return 0;} #endif /* |