Skip to content

Commit

Permalink
x86: mce: Disable preemption when calling raise_local()
Browse files Browse the repository at this point in the history
raise_mce() has a code path which does not disable preemption when the
raise_local() is called. The per cpu variable access in raise_local()
depends on preemption being disabled to be functional. So that code
path was either never tested or never tested with CONFIG_DEBUG_PREEMPT
enabled.

Add the missing preempt_disable/enable() pair around the call.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Chen Gong <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
  • Loading branch information
KAGA-KOKO authored and aegl committed Aug 3, 2012
1 parent 0d7614f commit ea22571
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/cpu/mcheck/mce-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ static void raise_mce(struct mce *m)
put_online_cpus();
} else
#endif
{
preempt_disable();
raise_local();
preempt_enable();
}
}

/* Error injection interface */
Expand Down

0 comments on commit ea22571

Please sign in to comment.