alistair23-linux/arch/x86/kernel/cpu/mcheck
Ingo Molnar f436f8bb73 x86: EDAC: MCE: Fix MCE decoding callback logic
Make decoding of MCEs happen only on AMD hardware by registering a
non-default callback only on CPU families which support it.

While looking at the interaction of decode_mce() with the other MCE
code i also noticed a few other things and made the following
cleanups/fixes:

 - Fixed the mce_decode() weak alias - a weak alias is really not
   good here, it should be a proper callback. A weak alias will be
   overriden if a piece of code is built into the kernel - not
   good, obviously.

 - The patch initializes the callback on AMD family 10h and 11h.

 - Added the more correct fallback printk of:

	No support for human readable MCE decoding on this CPU type.
	Transcribe the message and run it through 'mcelog --ascii' to decode.

   On CPUs that dont have a decoder.

 - Made the surrounding code more readable.

Note that the callback allows us to have a default fallback -
without having to check the CPU versions during the printout
itself. When an EDAC module registers itself, it can install the
decode-print function.

(there's no unregister needed as this is core code.)

version -v2 by Borislav Petkov:

 - add K8 to the set of supported CPUs

 - always build in edac_mce_amd since we use an early_initcall now

 - fix checkpatch warnings

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <20091001141432.GA11410@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-10-02 15:42:18 +02:00
..
Makefile x86: mce: Rename CONFIG_X86_NEW_MCE to CONFIG_X86_MCE 2009-07-09 18:39:47 -07:00
mce-inject.c x86: mce, inject: Use real inject-msg in raise_local 2009-09-22 21:06:37 +02:00
mce-internal.h x86, mce: Move debugfs mce dir creating to mce.c 2009-08-10 13:58:53 -07:00
mce-severity.c x86, mce: Fix compilation with !CONFIG_DEBUG_FS in mce-severity.c 2009-09-14 12:01:04 -07:00
mce.c x86: EDAC: MCE: Fix MCE decoding callback logic 2009-10-02 15:42:18 +02:00
mce_amd.c x86, mce: Fix compile warning in case of CONFIG_SMP=n 2009-09-19 19:48:14 +02:00
mce_intel.c x86: mce: macros to compute banks MSRs 2009-07-09 18:39:47 -07:00
p5.c x86, mce: make mce_disabled boolean 2009-06-16 16:56:07 -07:00
therm_throt.c x86: mce: Fix thermal throttling message storm 2009-09-22 17:30:45 +02:00
threshold.c x86, mce: enable MCE_INTEL for 32bit new MCE 2009-05-28 09:24:13 -07:00
winchip.c x86, mce: unify mce.h 2009-06-16 16:56:07 -07:00