x86/MCE: Report only DRAM ECC as memory errors on AMD systems
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 18 Dec 2017 11:37:13 +0000 (12:37 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 18 Dec 2017 11:58:29 +0000 (12:58 +0100)
commitc6708d50f166bea2d763c96485d31fdbc50204f1
tree4d84ef91fab54567c428b14e29e393c56822492a
parent11cf887728a3d1de77cc12ce247b64ef32608891
x86/MCE: Report only DRAM ECC as memory errors on AMD systems

The MCA_STATUS[ErrorCodeExt] field is very bank type specific.
We currently check if the ErrorCodeExt value is 0x0 or 0x8 in
mce_is_memory_error(), but we don't check the bank number. This means
that we could flag non-memory errors as memory errors.

We know that we want to flag DRAM ECC errors as memory errors, so let's do
those cases first. We can add more cases later when needed.

Define a wrapper function in mce_amd.c so we can use SMCA enums.

[ bp: Remove brackets around return statements. ]

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20171207203955.118171-2-Yazen.Ghannam@amd.com
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mcheck/mce_amd.c