Skip to contentSkip to conversation

trival patch: disable interrupt in play_dead

PATCH Shaohua Li 1 participant 1 message Nov 28, 2005

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

It's physical CPU hotplug now, so disable interrupt in play_dead.

---

 linux-2.6.14-root/arch/x86_64/kernel/process.c |    5 +++--
 linux-2.6.14-root/include/asm-x86_64/system.h  |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
arch/x86_64/kernel/process.c renamed from arch/x86_64/kernel/process.c~cpuhp-disable-interrupt +3 -2
diff -puN arch/x86_64/kernel/process.c~cpuhp-disable-interrupt arch/x86_64/kernel/process.c
@@ -157,7 +157,7 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait);
 DECLARE_PER_CPU(int, cpu_state);
 
 #include <asm/nmi.h>
-/* We don't actually take CPU down, just spin without interrupts. */
+/* We halt the CPU with physical CPU hotplug */
 static inline void play_dead(void)
 {
 	idle_task_exit();
@@ -166,8 +166,9 @@ static inline void play_dead(void)
 	/* Ack it */
 	__get_cpu_var(cpu_state) = CPU_DEAD;
 
+	local_irq_disable();
 	while (1)
-		safe_halt();
+		halt();
 }
 #else
 static inline void play_dead(void)
include/asm-x86_64/system.h renamed from include/asm-x86_64/system.h~cpuhp-disable-interrupt +2 -0
diff -puN include/asm-x86_64/system.h~cpuhp-disable-interrupt include/asm-x86_64/system.h
@@ -315,6 +315,8 @@ static inline unsigned long __cmpxchg(vo
 #define local_irq_enable()	__asm__ __volatile__("sti": : :"memory")
 /* used in the idle loop; sti takes one instruction cycle to complete */
 #define safe_halt()		__asm__ __volatile__("sti; hlt": : :"memory")
+/* used when interrupts are already enabled or to shutdown the processor */
+#define halt()			__asm__ __volatile__("hlt": : :"memory")
 
 #define irqs_disabled()			\
 ({					\

_