@@ -307,6 +307,7 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs)
static noinstr int mce_severity_amd(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{
int ret;
+ char *panic_msg;
/*
* Default return value: Action required, the error must be handled
@@ -316,6 +317,7 @@ static noinstr int mce_severity_amd(struct mce *m, struct pt_regs *regs, char **
/* Processor Context Corrupt, no need to fumble too much, die! */
if (m->status & MCI_STATUS_PCC) {
+ panic_msg = "Processor Context Corrupt";
ret = MCE_PANIC_SEVERITY;
goto amd_severity;
}
@@ -339,16 +341,21 @@ static noinstr int mce_severity_amd(struct mce *m, struct pt_regs *regs, char **
if (((m->status & MCI_STATUS_OVER) && !mce_flags.overflow_recov)
|| !mce_flags.succor) {
+ panic_msg = "Uncorrected unrecoverable error";
ret = MCE_PANIC_SEVERITY;
goto amd_severity;
}
if (error_context(m, regs) == IN_KERNEL) {
+ panic_msg = "Uncorrected error in kernel context";
ret = MCE_PANIC_SEVERITY;
}
amd_severity:
+ if (msg && panic_msg)
+ *msg = panic_msg;
+
return ret;
}
When a machine error is graded as PANIC by AMD grading logic, the MCE handler calls mce_panic(). The notification chain does not come into effect so the AMD EDAC driver does not decode the errors. In these cases, the messages displayed to the user are more cryptic and miss information that might be relevant, like the context in which the error took place. Fix the above issue including messages on AMD's grading logic for machine errors graded as PANIC. Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com> --- arch/x86/kernel/cpu/mce/severity.c | 7 +++++++ 1 file changed, 7 insertions(+)