diff options
-rw-r--r-- | arch/x86/include/asm/thread_info.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 1d4e4f279a32..a2fa1899494e 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
@@ -159,8 +159,7 @@ DECLARE_PER_CPU(unsigned long, kernel_stack); | |||
159 | static inline struct thread_info *current_thread_info(void) | 159 | static inline struct thread_info *current_thread_info(void) |
160 | { | 160 | { |
161 | struct thread_info *ti; | 161 | struct thread_info *ti; |
162 | ti = (void *)(this_cpu_read_stable(kernel_stack) + | 162 | ti = (void *)(this_cpu_sp0() - THREAD_SIZE); |
163 | KERNEL_STACK_OFFSET - THREAD_SIZE); | ||
164 | return ti; | 163 | return ti; |
165 | } | 164 | } |
166 | 165 | ||
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 9965bd1916db..fa290586ed37 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -174,8 +174,8 @@ void ist_begin_non_atomic(struct pt_regs *regs) | |||
174 | * will catch asm bugs and any attempt to use ist_preempt_enable | 174 | * will catch asm bugs and any attempt to use ist_preempt_enable |
175 | * from double_fault. | 175 | * from double_fault. |
176 | */ | 176 | */ |
177 | BUG_ON(((current_stack_pointer() ^ this_cpu_read_stable(kernel_stack)) | 177 | BUG_ON((unsigned long)(this_cpu_sp0() - current_stack_pointer()) >= |
178 | & ~(THREAD_SIZE - 1)) != 0); | 178 | THREAD_SIZE); |
179 | 179 | ||
180 | preempt_count_sub(HARDIRQ_OFFSET); | 180 | preempt_count_sub(HARDIRQ_OFFSET); |
181 | } | 181 | } |