Skip to content

Commit

Permalink
x86_64: oops_begin() fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jun 9, 2007
1 parent 12710a5 commit b39b703
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,14 @@ static unsigned int die_nest_count;

unsigned __kprobes long oops_begin(void)
{
int cpu = smp_processor_id();
int cpu;
unsigned long flags;

oops_enter();

/* racy, but better than risking deadlock. */
local_irq_save(flags);
cpu = smp_processor_id();
if (!spin_trylock(&die_lock)) {
if (cpu == die_owner)
/* nested oops. should stop eventually */;
Expand Down

0 comments on commit b39b703

Please sign in to comment.