[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1505830031-9630-1-git-send-email-Yazen.Ghannam@amd.com>
Date: Tue, 19 Sep 2017 09:07:11 -0500
From: Yazen Ghannam <Yazen.Ghannam@....com>
To: linux-edac@...r.kernel.org
Cc: Borislav Petkov <bp@...e.de>, Tony Luck <tony.luck@...el.com>,
x86@...nel.org, linux-kernel@...r.kernel.org,
Yazen Ghannam <yazen.ghannam@....com>,
"# v4 . 9 . ." <stable@...r.kernel.org>
Subject: [PATCH] x86/MCE/AMD: Always give PANIC severity for UC errors in kernel context
From: Yazen Ghannam <yazen.ghannam@....com>
Our current AMD severity logic can possibly give MCE_AR_SEVERITY for
uncorrectable errors in kernel context. The current #MC handler only calls
memory_failure() on errors in user context, but older versions will call
memory_failure() unconditionally. In older versions, the system can get
stuck in a loop as memory_failure() will try to handle the bad kernel
memory and find it busy.
Return MCE_PANIC_SEVERITY for all UC errors IN_KERNEL context. Newer
kernel versions have IN_KERNEL_RECOV context for recoverable kernel errors.
All others kernel uncorrectable errors can be considered unrecoverable.
Fixes: bf80bbd7dcf5 (x86/mce: Add an AMD severities-grading function)
Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
Cc: <stable@...r.kernel.org> # v4.9..
---
arch/x86/kernel/cpu/mcheck/mce-severity.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index 2773c8547f69..f5518706baa6 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -245,6 +245,9 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc
if (m->status & MCI_STATUS_UC) {
+ if (ctx == IN_KERNEL)
+ return MCE_PANIC_SEVERITY;
+
/*
* On older systems where overflow_recov flag is not present, we
* should simply panic if an error overflow occurs. If
@@ -255,10 +258,6 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc
if (mce_flags.smca)
return mce_severity_amd_smca(m, ctx);
- /* software can try to contain */
- if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL))
- return MCE_PANIC_SEVERITY;
-
/* kill current process */
return MCE_AR_SEVERITY;
} else {
--
2.7.4
Powered by blists - more mailing lists