RE: [Patch V0] x86, mce: Ensure offline CPU's don't participate in mce rendezvous process.

From: Luck, Tony
Date: Fri Dec 04 2015 - 13:30:46 EST


> Whether it is kosher or not is beside the point. Why should an offlined
> CPU even noodle through all that code if it doesn't need/have to? It can
> return immediately instead.

Ashok wants to move in stage 2 to having the offline cpu scan banks and report
any errors seen there. To do that we'll have to run through a fair bit of the
do_machine_check() code.

But ... if you want a super safe version to put the stable tag on ... we could
just have something like this at the head of do_machine_check()

int cpu = smp_processor_id();

if (cpu_is_offline(cpu)) {
rdmsr(MCG_STATUS);
if (RIPV bit set) {
wrmsr(MCG_STATUS, 0);
return;
}
// can we do anything here? Offline cpu has no place to return to.
// There are no good answers ... falling into the regular code is
// what we did historically
}

-Tony