Re: [PATCH v3 2/3] x86/smp native_play_dead: Prefer cpuidle_play_dead() over mwait_play_dead()

From: Peter Zijlstra
Date: Thu Nov 14 2024 - 07:03:32 EST


On Tue, Nov 12, 2024 at 03:01:27PM +0100, Peter Zijlstra wrote:

> No, not mwait hint. We need an instruction that:
>
> - goes to deepest C state
> - drops into WAIT-for-Start-IPI (SIPI)
>
> Notably, it should not wake from:
>
> - random memory writes
> - NMI, MCE, SMI and other such non-maskable thingies
> - anything else -- the memory pointed to by RIP might no longer exist
>
> Lets call the instruction: DEAD.

So, turns out that when you send INIT to an AP it does the whole drop
into Wait-for-SIPI and ignore non-maskable crap.

The reason we don't do that is because INIT to CPU0 (BP) is somewhat
fatal, but since Thomas killed all that CPU0 hotplug crap, I think we
can actually go do that.