Re: [RFC] #MC mess

Andy Lutomirski
2020-02-18T23:17:23Z

> On Feb 18, 2020, at 12:02 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> ﻿On Tue, Feb 18, 2020 at 06:20:38PM +0000, Luck, Tony wrote:
>>> Anything else I'm missing? It is likely...
>>
>> + hw_breakpoint_disable();
>> + static_key_disable(&__tracepoint_read_msr.key);
>> + tracing_off();
>> +
>> ist_enter(regs);
>>
>> How about some code to turn all those back on for a recoverable (where we actually recovered) #MC?
>
> Then please rewrite the #MC entry code to deal with nested exceptions
> unmasking the MCE, very similr to NMI.
>
> The moment you allow tracing, jump_labels or anything else you can
> expect #PF, #BP and probably #DB while inside #MC, those will then IRET
> and re-enable the #MC.

Huh? As I understand it, there is no such thing as MCE masking. There are two states:

CR4.MCE=1: MCE is delivered when it occurs.

CR4.MCE=0: MCE causes shutdown

MC delivery sets MCE=0.

So, basically, without LMCE, we are irredeemably screwed. With LMCE, we are still hosed if we nest an MCE inside a recoverable MCE. We can play some games to make the OOPS more reliable, but we are still mostly screwed.

The x86 MCE architecture sucks.

>
> The current situation is completely and utterly buggered.