diff options
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 2d8a371d4339..0a0aa1cec8f1 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -188,7 +188,7 @@ void dump_stack(void) | |||
188 | } | 188 | } |
189 | EXPORT_SYMBOL(dump_stack); | 189 | EXPORT_SYMBOL(dump_stack); |
190 | 190 | ||
191 | static raw_spinlock_t die_lock = __RAW_SPIN_LOCK_UNLOCKED; | 191 | static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; |
192 | static int die_owner = -1; | 192 | static int die_owner = -1; |
193 | static unsigned int die_nest_count; | 193 | static unsigned int die_nest_count; |
194 | 194 | ||
@@ -207,11 +207,11 @@ unsigned __kprobes long oops_begin(void) | |||
207 | /* racy, but better than risking deadlock. */ | 207 | /* racy, but better than risking deadlock. */ |
208 | raw_local_irq_save(flags); | 208 | raw_local_irq_save(flags); |
209 | cpu = smp_processor_id(); | 209 | cpu = smp_processor_id(); |
210 | if (!__raw_spin_trylock(&die_lock)) { | 210 | if (!arch_spin_trylock(&die_lock)) { |
211 | if (cpu == die_owner) | 211 | if (cpu == die_owner) |
212 | /* nested oops. should stop eventually */; | 212 | /* nested oops. should stop eventually */; |
213 | else | 213 | else |
214 | __raw_spin_lock(&die_lock); | 214 | arch_spin_lock(&die_lock); |
215 | } | 215 | } |
216 | die_nest_count++; | 216 | die_nest_count++; |
217 | die_owner = cpu; | 217 | die_owner = cpu; |
@@ -231,7 +231,7 @@ void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) | |||
231 | die_nest_count--; | 231 | die_nest_count--; |
232 | if (!die_nest_count) | 232 | if (!die_nest_count) |
233 | /* Nest count reaches zero, release the lock. */ | 233 | /* Nest count reaches zero, release the lock. */ |
234 | __raw_spin_unlock(&die_lock); | 234 | arch_spin_unlock(&die_lock); |
235 | raw_local_irq_restore(flags); | 235 | raw_local_irq_restore(flags); |
236 | oops_exit(); | 236 | oops_exit(); |
237 | 237 | ||
@@ -268,11 +268,12 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) | |||
268 | 268 | ||
269 | show_registers(regs); | 269 | show_registers(regs); |
270 | #ifdef CONFIG_X86_32 | 270 | #ifdef CONFIG_X86_32 |
271 | sp = (unsigned long) (®s->sp); | 271 | if (user_mode_vm(regs)) { |
272 | savesegment(ss, ss); | ||
273 | if (user_mode(regs)) { | ||
274 | sp = regs->sp; | 272 | sp = regs->sp; |
275 | ss = regs->ss & 0xffff; | 273 | ss = regs->ss & 0xffff; |
274 | } else { | ||
275 | sp = kernel_stack_pointer(regs); | ||
276 | savesegment(ss, ss); | ||
276 | } | 277 | } |
277 | printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip); | 278 | printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip); |
278 | print_symbol("%s", regs->ip); | 279 | print_symbol("%s", regs->ip); |