diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-06-08 16:47:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-08 20:23:34 -0400 |
commit | b39b70366c5be68affe9777de72846540d840464 (patch) | |
tree | faae0447c5661e87061c5a046db4bb9cf181d0c9 /arch | |
parent | 12710a56cb56e81bd8f457cc2f50c2ebfc0cb390 (diff) |
x86_64: oops_begin() fix
We don't want to see this:
> BUG: using smp_processor_id() in preemptible [00000001] code: bash/3857
> caller is oops_begin+0xb/0x6f
>
> Call Trace:
> [<ffffffff8020ab4d>] show_trace+0x34/0x4f
> [<ffffffff8020ab7a>] dump_stack+0x12/0x17
> [<ffffffff8030d92d>] debug_smp_processor_id+0xad/0xbc
> [<ffffffff8042388f>] oops_begin+0xb/0x6f
> [<ffffffff8042520b>] do_page_fault+0x66a/0x7c0
> [<ffffffff804234bd>] error_exit+0x0/0x84
>
coming out when the kernel is trying to oops.
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/kernel/traps.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index cb29fb96948d..aac1c0be54c6 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -465,13 +465,14 @@ static unsigned int die_nest_count; | |||
465 | 465 | ||
466 | unsigned __kprobes long oops_begin(void) | 466 | unsigned __kprobes long oops_begin(void) |
467 | { | 467 | { |
468 | int cpu = smp_processor_id(); | 468 | int cpu; |
469 | unsigned long flags; | 469 | unsigned long flags; |
470 | 470 | ||
471 | oops_enter(); | 471 | oops_enter(); |
472 | 472 | ||
473 | /* racy, but better than risking deadlock. */ | 473 | /* racy, but better than risking deadlock. */ |
474 | local_irq_save(flags); | 474 | local_irq_save(flags); |
475 | cpu = smp_processor_id(); | ||
475 | if (!spin_trylock(&die_lock)) { | 476 | if (!spin_trylock(&die_lock)) { |
476 | if (cpu == die_owner) | 477 | if (cpu == die_owner) |
477 | /* nested oops. should stop eventually */; | 478 | /* nested oops. should stop eventually */; |