x86, mce: check early in exception handler if panic is needed
authorAndi Kleen <andi@firstfloor.org>
Wed, 27 May 2009 19:56:55 +0000 (21:56 +0200)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 3 Jun 2009 21:40:39 +0000 (14:40 -0700)
commitbd19a5e6b73df276e1ccedf9059e9ee70c372d7d
treef5e10b6340cfa416efa7b1d0c82712d8fbb2c94b
parent817f32d02a52dd7f5941534e0699883691e918df
x86, mce: check early in exception handler if panic is needed

The exception handler should behave differently if the exception is
fatal versus one that can be returned from.  In the first case it should
never clear any registers because these need to be preserved
for logging after the next boot. Otherwise it should clear them
on each CPU step by step so that other CPUs sharing the same bank don't
see duplicate events. Otherwise we risk reporting events multiple
times on any CPUs which have shared machine check banks, which
is a common problem on Intel Nehalem which has both SMT (two
CPU threads sharing banks) and shared machine check banks in the uncore.

Determine early in a special pass if any event requires a panic.
This uses the mce_severity() function added earlier.

This is needed for the next patch.

Also fixes a problem together with an earlier patch
that corrected events weren't logged on a fatal MCE.

[ Impact: Feature ]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/kernel/cpu/mcheck/mce.c