aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/traps_64.c')
-rw-r--r--arch/x86/kernel/traps_64.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index b4a9b3db1994..df690c3fa458 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -462,7 +462,7 @@ void out_of_line_bug(void)
462EXPORT_SYMBOL(out_of_line_bug); 462EXPORT_SYMBOL(out_of_line_bug);
463#endif 463#endif
464 464
465static DEFINE_SPINLOCK(die_lock); 465static raw_spinlock_t die_lock = __RAW_SPIN_LOCK_UNLOCKED;
466static int die_owner = -1; 466static int die_owner = -1;
467static unsigned int die_nest_count; 467static unsigned int die_nest_count;
468 468
@@ -474,13 +474,13 @@ unsigned __kprobes long oops_begin(void)
474 oops_enter(); 474 oops_enter();
475 475
476 /* racy, but better than risking deadlock. */ 476 /* racy, but better than risking deadlock. */
477 local_irq_save(flags); 477 raw_local_irq_save(flags);
478 cpu = smp_processor_id(); 478 cpu = smp_processor_id();
479 if (!spin_trylock(&die_lock)) { 479 if (!__raw_spin_trylock(&die_lock)) {
480 if (cpu == die_owner) 480 if (cpu == die_owner)
481 /* nested oops. should stop eventually */; 481 /* nested oops. should stop eventually */;
482 else 482 else
483 spin_lock(&die_lock); 483 __raw_spin_lock(&die_lock);
484 } 484 }
485 die_nest_count++; 485 die_nest_count++;
486 die_owner = cpu; 486 die_owner = cpu;
@@ -494,12 +494,10 @@ void __kprobes oops_end(unsigned long flags)
494 die_owner = -1; 494 die_owner = -1;
495 bust_spinlocks(0); 495 bust_spinlocks(0);
496 die_nest_count--; 496 die_nest_count--;
497 if (die_nest_count) 497 if (!die_nest_count)
498 /* We still own the lock */
499 local_irq_restore(flags);
500 else
501 /* Nest count reaches zero, release the lock. */ 498 /* Nest count reaches zero, release the lock. */
502 spin_unlock_irqrestore(&die_lock, flags); 499 __raw_spin_unlock(&die_lock);
500 raw_local_irq_restore(flags);
503 if (panic_on_oops) 501 if (panic_on_oops)
504 panic("Fatal exception"); 502 panic("Fatal exception");
505 oops_exit(); 503 oops_exit();