Re: [PATCH 2/3 V2] x86/mce: Fix incorrect "Machine check from unknown source" message

From: Luck, Tony
Date: Tue May 29 2018 - 14:54:30 EST


On Tue, May 29, 2018 at 07:53:14PM +0200, Borislav Petkov wrote:
> Nah, the cleanups will all go ontop. This is just a dirty branch to show
> my intention but yours go first and then the cleanup.


Couple of thoughts:

In "x86/mce: Carve out bank scanning code" you drop the extra
call to mce_severity() that I just added:

@@ -1310,10 +1318,8 @@ void do_machine_check(struct pt_regs *regs, long error_code)
* fatal error. We call "mce_severity()" again to
* make sure we have the right "msg".
*/
- if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3) {
- severity = mce_severity(&m, cfg->tolerant, &msg, true);
+ if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3)
mce_panic("Local fatal machine check!", &m, msg);
- }
}

But "msg" won't have been filled in with the right message to match
the error in "m" (__mc_scan_banks() doesn't update "msg").



In "x86/mce: Exit properly when no banks to poll" you
leap right to the end. I'm wondering whether this can
ever happen? I mean, if there are no machine check banks,
then how did we get a machine check?

Both the original, and your new code, skip the:

mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);

which seems bad. That leaves MCG_STATUS.MCIP set ... so a second
machine check would just reset the machine.

-Tony

P.S. What happened to my "part 3/3" (updating the Skylake quirk)
... does that belong in somebody else's tree?