diff options
author | Li Shaohua <shaohua.li@intel.com> | 2005-06-25 17:54:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:30 -0400 |
commit | e1367daf3eed5cd619ee88c9907e1e6ddaa58406 (patch) | |
tree | dce60efefba356e0a914669587586a6174e41b94 /arch/i386/kernel/process.c | |
parent | 0bb3184df537002a742bafddf3f4fb482b7fe610 (diff) |
[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.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index e06f2dc7123d..5f8cfa6b7940 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -152,21 +152,19 @@ static void poll_idle (void) | |||
152 | /* We don't actually take CPU down, just spin without interrupts. */ | 152 | /* We don't actually take CPU down, just spin without interrupts. */ |
153 | static inline void play_dead(void) | 153 | static inline void play_dead(void) |
154 | { | 154 | { |
155 | /* This must be done before dead CPU ack */ | ||
156 | cpu_exit_clear(); | ||
157 | wbinvd(); | ||
158 | mb(); | ||
155 | /* Ack it */ | 159 | /* Ack it */ |
156 | __get_cpu_var(cpu_state) = CPU_DEAD; | 160 | __get_cpu_var(cpu_state) = CPU_DEAD; |
157 | 161 | ||
158 | /* We shouldn't have to disable interrupts while dead, but | 162 | /* |
159 | * some interrupts just don't seem to go away, and this makes | 163 | * With physical CPU hotplug, we should halt the cpu |
160 | * it "work" for testing purposes. */ | 164 | */ |
161 | /* Death loop */ | ||
162 | while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE) | ||
163 | cpu_relax(); | ||
164 | |||
165 | local_irq_disable(); | 165 | local_irq_disable(); |
166 | __flush_tlb_all(); | 166 | while (1) |
167 | cpu_set(smp_processor_id(), cpu_online_map); | 167 | __asm__ __volatile__("hlt":::"memory"); |
168 | enable_APIC_timer(); | ||
169 | local_irq_enable(); | ||
170 | } | 168 | } |
171 | #else | 169 | #else |
172 | static inline void play_dead(void) | 170 | static inline void play_dead(void) |