RE: [PATCH] x86, mce, severities: Add AMD severities function

From: Luck, Tony
Date: Fri Mar 20 2015 - 13:50:07 EST


>> And I call this from mcheck_init().
>> I tested the above bits on AMD and the severities grading works fine.
>>
>> Should we also come up with a '_default' function to assign to mce_severity
>> function pointer?
>
>I think that should be
>
> default:
> WARN_ONCE("WTF?!");
> break;

mcheck_init() is called unconditionally from setup_arch(). So if anyone is
still using a Cyrix, Transmeta or other non-Intel, non-Amd processor we'd trip this WARN_ON.

I think you can have a default severity function that just does:

return MCE_PANIC_SEVERITY;

just to avoid the unpleasant thought that we might jump through a NULL pointer
if we did somehow end up in do_machine_check() on another vendors cpu.

-Tony