Re: [patch 26/30] x86/microcode: Protect against instrumentation

From: Peter Zijlstra
Date: Thu Aug 10 2023 - 16:37:11 EST


On Thu, Aug 10, 2023 at 08:38:04PM +0200, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> The wait for control loop in which the siblings are waiting for the
> microcode update on the primary thread must be protected against
> instrumentation as instrumentation can end up in #INT3, #DB or #PF, which
> then returns with IRET. That IRET reenables NMI which is the opposite of
> what the NMI rendezvouz is trying to achieve.

asm_exc_nmi will re-enable NMIs when DEBUG_ENTRY before we reach C.
Late loading had better depend on !DEBUG_ENTRY.