x86/mce/AMD: Redo error logging from APIC LVT interrupt handlers
authorYazen Ghannam <yazen.ghannam@amd.com>
Fri, 19 May 2017 09:39:14 +0000 (11:39 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 21 May 2017 19:55:13 +0000 (21:55 +0200)
commit37d43acfd79f9c53289e9990c344cbd5b4db4bd4
tree1daa9f2bbcbdb60b85dbc6b22a5d8ef8bcfabf7a
parent473e90b2e8356f084dcf9c815a5170d4d4925897
x86/mce/AMD: Redo error logging from APIC LVT interrupt handlers

We have support for the new SMCA MCA_DE{STAT,ADDR} registers in Linux.
So we've used these registers in place of MCA_{STATUS,ADDR} on SMCA
systems.

However, the guidance for current SMCA implementations of is to continue
using MCA_{STATUS,ADDR} and to use MCA_DE{STAT,ADDR} only if a Deferred
error was not found in the former registers. If we logged a Deferred
error in MCA_STATUS then we should also clear MCA_DESTAT. This also
means we shouldn't clear MCA_CONFIG[LogDeferredInMcaStat].

Rework __log_error() to only log an error and add helpers for the
different error types being logged from the corresponding interrupt
handlers.

Boris: carve out common functionality into a _log_error_bank(). Cleanup
comments, check MCi_STATUS bits before reading MSRs. Streamline flow.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1493147772-2721-1-git-send-email-Yazen.Ghannam@amd.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/cpu/mcheck/mce_amd.c