summaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/process.c
diff options
context:
space:
mode:
authorLi Shaohua <shaohua.li@intel.com>2005-06-25 14:54:56 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 16:24:30 -0700
commite1367daf3eed5cd619ee88c9907e1e6ddaa58406 (patch)
treedce60efefba356e0a914669587586a6174e41b94 /arch/i386/kernel/process.c
parent0bb3184df537002a742bafddf3f4fb482b7fe610 (diff)
downloadop-kernel-dev-e1367daf3eed5cd619ee88c9907e1e6ddaa58406.zip
op-kernel-dev-e1367daf3eed5cd619ee88c9907e1e6ddaa58406.tar.gz
[PATCH] cpu state clean after hot remove
Clean CPU states in order to reuse smp boot code for CPU hotplug. Signed-off-by: Li Shaohua<shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/process.c')
-rw-r--r--arch/i386/kernel/process.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index e06f2dc..5f8cfa6 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -152,21 +152,19 @@ static void poll_idle (void)
/* We don't actually take CPU down, just spin without interrupts. */
static inline void play_dead(void)
{
+ /* This must be done before dead CPU ack */
+ cpu_exit_clear();
+ wbinvd();
+ mb();
/* Ack it */
__get_cpu_var(cpu_state) = CPU_DEAD;
- /* We shouldn't have to disable interrupts while dead, but
- * some interrupts just don't seem to go away, and this makes
- * it "work" for testing purposes. */
- /* Death loop */
- while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
- cpu_relax();
-
+ /*
+ * With physical CPU hotplug, we should halt the cpu
+ */
local_irq_disable();
- __flush_tlb_all();
- cpu_set(smp_processor_id(), cpu_online_map);
- enable_APIC_timer();
- local_irq_enable();
+ while (1)
+ __asm__ __volatile__("hlt":::"memory");
}
#else
static inline void play_dead(void)
OpenPOWER on IntegriCloud