aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps_32.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-10-19 14:35:03 -0400
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 14:35:03 -0400
commit39743c9ef717fd4f2b5583f010115c5f2482b8ae (patch)
tree960daf67c159ddbce5323342db1fced74524bf74 /arch/x86/kernel/traps_32.c
parentb1992df3f070475b243b12ca1241a5938ef5f9bc (diff)
x86: use raw locks during oopses
Don't want any lockdep or other fragile machinery to run during oopses. Use raw spinlocks directly for oops locking. Also disables irq flag tracing there. [ tglx: arch/x86 adaptation ] Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_32.c')
-rw-r--r--arch/x86/kernel/traps_32.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 746fad2c504f..3f02e0f42e6a 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -350,11 +350,11 @@ int is_valid_bugaddr(unsigned long eip)
350void die(const char * str, struct pt_regs * regs, long err) 350void die(const char * str, struct pt_regs * regs, long err)
351{ 351{
352 static struct { 352 static struct {
353 spinlock_t lock; 353 raw_spinlock_t lock;
354 u32 lock_owner; 354 u32 lock_owner;
355 int lock_owner_depth; 355 int lock_owner_depth;
356 } die = { 356 } die = {
357 .lock = __SPIN_LOCK_UNLOCKED(die.lock), 357 .lock = __RAW_SPIN_LOCK_UNLOCKED,
358 .lock_owner = -1, 358 .lock_owner = -1,
359 .lock_owner_depth = 0 359 .lock_owner_depth = 0
360 }; 360 };
@@ -365,13 +365,14 @@ void die(const char * str, struct pt_regs * regs, long err)
365 365
366 if (die.lock_owner != raw_smp_processor_id()) { 366 if (die.lock_owner != raw_smp_processor_id()) {
367 console_verbose(); 367 console_verbose();
368 spin_lock_irqsave(&die.lock, flags); 368 __raw_spin_lock(&die.lock);
369 raw_local_save_flags(flags);
369 die.lock_owner = smp_processor_id(); 370 die.lock_owner = smp_processor_id();
370 die.lock_owner_depth = 0; 371 die.lock_owner_depth = 0;
371 bust_spinlocks(1); 372 bust_spinlocks(1);
372 } 373 }
373 else 374 else
374 local_save_flags(flags); 375 raw_local_save_flags(flags);
375 376
376 if (++die.lock_owner_depth < 3) { 377 if (++die.lock_owner_depth < 3) {
377 unsigned long esp; 378 unsigned long esp;
@@ -415,7 +416,8 @@ void die(const char * str, struct pt_regs * regs, long err)
415 bust_spinlocks(0); 416 bust_spinlocks(0);
416 die.lock_owner = -1; 417 die.lock_owner = -1;
417 add_taint(TAINT_DIE); 418 add_taint(TAINT_DIE);
418 spin_unlock_irqrestore(&die.lock, flags); 419 __raw_spin_unlock(&die.lock);
420 raw_local_irq_restore(flags);
419 421
420 if (!regs) 422 if (!regs)
421 return; 423 return;