Re: PROBLEM: mce: [Hardware Error] from dmesg -l emerg

From: Luck, Tony
Date: Mon May 21 2018 - 19:11:46 EST


On Tue, May 22, 2018 at 02:43:37AM +0530, Jeffrin Thalakkottoor wrote:
> mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 5: ee0000000040110b
> mce: [Hardware Error]: TSC 0 ADDR 160000080 MISC 5040008086
> mce: [Hardware Error]: PROCESSOR 0:306d4 TIME 1526932210 SOCKET 0 APIC
> 0 microcode 2a

The problem is that "mcelog --ascii" is expecting the first line to
look like:

CPU 0: Machine Check Exception: 0 Bank 5: ee0000000040110b

This seems to have been broken by commit:

cd9c57cad3fe ("x86/MCE: Dump MCE to dmesg if no consumers")

relevent part is this ... where we now conditionally include the
word "Exception".

-static void print_mce(struct mce *m)
+static void __print_mce(struct mce *m)
{
- int ret = 0;
-
- pr_emerg(HW_ERR "CPU %d: Machine Check Exception: %Lx Bank %d: %016Lx\n",
- m->extcpu, m->mcgstatus, m->bank, m->status);
+ pr_emerg(HW_ERR "CPU %d: Machine Check%s: %Lx Bank %d: %016Lx\n",
+ m->extcpu,
+ (m->mcgstatus & MCG_STATUS_MCIP ? " Exception" : ""),
+ m->mcgstatus, m->bank, m->status);

While this is a bit easier to read, no new information is included as we
do print the value of m->mcgstatus.

Sadly, the change was made back in v4.10 ... so reverting it won't
help all the people running kernels built in the last fifteen months :-(

I'll see if I can get Andi to take a patch for mcelog to accept the
line with or without the " Exception".

Oh ... one more thing. Did your e-mail client line wrap that last line?

> mce: [Hardware Error]: PROCESSOR 0:306d4 TIME 1526932210 SOCKET 0 APIC
> 0 microcode 2a

That should all be on one line.

-Tony