From: Andrew Morton Date: Fri, 8 Jun 2007 20:47:01 +0000 (-0700) Subject: x86_64: oops_begin() fix X-Git-Tag: v2.6.22-rc5~68 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b39b70366c5be68affe9777de72846540d840464;p=linux-2.6 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: > [] show_trace+0x34/0x4f > [] dump_stack+0x12/0x17 > [] debug_smp_processor_id+0xad/0xbc > [] oops_begin+0xb/0x6f > [] do_page_fault+0x66a/0x7c0 > [] error_exit+0x0/0x84 > coming out when the kernel is trying to oops. Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index cb29fb9694..aac1c0be54 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; 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 */;