aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 2a8ccb9238b4..ca80394ef5b8 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -86,30 +86,12 @@ void exit_idle(void)
86 __exit_idle(); 86 __exit_idle();
87} 87}
88 88
89#ifdef CONFIG_HOTPLUG_CPU 89#ifndef CONFIG_SMP
90DECLARE_PER_CPU(int, cpu_state);
91
92#include <linux/nmi.h>
93/* We halt the CPU with physical CPU hotplug */
94static inline void play_dead(void)
95{
96 idle_task_exit();
97 c1e_remove_cpu(raw_smp_processor_id());
98
99 mb();
100 /* Ack it */
101 __get_cpu_var(cpu_state) = CPU_DEAD;
102
103 local_irq_disable();
104 /* mask all interrupts, flush any and all caches, and halt */
105 wbinvd_halt();
106}
107#else
108static inline void play_dead(void) 90static inline void play_dead(void)
109{ 91{
110 BUG(); 92 BUG();
111} 93}
112#endif /* CONFIG_HOTPLUG_CPU */ 94#endif
113 95
114/* 96/*
115 * The idle thread. There's no useful work to be 97 * The idle thread. There's no useful work to be
@@ -754,12 +736,12 @@ unsigned long get_wchan(struct task_struct *p)
754 if (!p || p == current || p->state == TASK_RUNNING) 736 if (!p || p == current || p->state == TASK_RUNNING)
755 return 0; 737 return 0;
756 stack = (unsigned long)task_stack_page(p); 738 stack = (unsigned long)task_stack_page(p);
757 if (p->thread.sp < stack || p->thread.sp > stack+THREAD_SIZE) 739 if (p->thread.sp < stack || p->thread.sp >= stack+THREAD_SIZE)
758 return 0; 740 return 0;
759 fp = *(u64 *)(p->thread.sp); 741 fp = *(u64 *)(p->thread.sp);
760 do { 742 do {
761 if (fp < (unsigned long)stack || 743 if (fp < (unsigned long)stack ||
762 fp > (unsigned long)stack+THREAD_SIZE) 744 fp >= (unsigned long)stack+THREAD_SIZE)
763 return 0; 745 return 0;
764 ip = *(u64 *)(fp+8); 746 ip = *(u64 *)(fp+8);
765 if (!in_sched_functions(ip)) 747 if (!in_sched_functions(ip))