Re: [PATCH v2 2/2] KVM: VMX: Invoke NMI handler via indirect call instead of INTn

From: Andy Lutomirski
Date: Mon Apr 26 2021 - 11:09:52 EST



> On Apr 26, 2021, at 7:51 AM, Andi Kleen <ak@xxxxxxxxxxxxxxx> wrote:
>
> 
>>
>>> The original code "int $2" can provide the needed CPU-hidden-NMI-masked
>>> when entering #NMI, but I doubt it about this change.
>>
>> How would "int $2" block NMIs? The hidden effect of this change (and I
>> should have reviewed better the effect on the NMI entry code) is that the
>> call will not use the IST anymore.
>
> My understanding is that int $2 does not block NMIs.
>
> So reentries might have been possible.
>

The C NMI code has its own reentrancy protection and has for years. It should work fine for this use case.

> -Andi