Skip to content

Commit

Permalink
x86: fix boot crash in NMI watchdog with CONFIG_CPUMASK_OFFSTACK=y an…
Browse files Browse the repository at this point in the history
…d flat APIC

fcef857 converted backtrace_mask to a
cpumask_var_t, and assumed check_nmi_watchdog was called before
nmi_watchdog_tick was ever called.  Steven's oops shows I was wrong.

This is something of a bandaid: I'm not sure we *should* be calling
nmi_watchdog_tick before check_nmi_watchdog.  Note that gcc eliminates
this test for the CONFIG_CPUMASK_OFFSTACK=n case.

[ Impact: fix boot crash in rare configs ]

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <alpine.DEB.2.00.0904202113520.10097@gandalf.stny.rr.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Rusty Russell authored and Ingo Molnar committed Apr 21, 2009
1 parent 06c38d5 commit 2f537a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/apic/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
touched = 1;
}

if (cpumask_test_cpu(cpu, backtrace_mask)) {
/* We can be called before check_nmi_watchdog, hence NULL check. */
if (backtrace_mask != NULL && cpumask_test_cpu(cpu, backtrace_mask)) {
static DEFINE_SPINLOCK(lock); /* Serialise the printks */

spin_lock(&lock);
Expand Down

0 comments on commit 2f537a9

Please sign in to comment.