Re: [PATCH 1/6] x86/idle: Remove broken MWAIT implementation

2025-07-03 Thread Andrew Cooper
On 03/07/2025 5:01 pm, Roger Pau Monné wrote: > On Wed, Jul 02, 2025 at 03:41:16PM +0100, Andrew Cooper wrote: >> cpuidle_wakeup_mwait() is a TOCTOU race. The cpumask_and() sampling >> cpuidle_mwait_flags can take a arbitrary period of time, and there's no >> guarantee that the target CPUs are sti

Re: [PATCH 1/6] x86/idle: Remove broken MWAIT implementation

2025-07-03 Thread Roger Pau Monné
On Wed, Jul 02, 2025 at 03:41:16PM +0100, Andrew Cooper wrote: > cpuidle_wakeup_mwait() is a TOCTOU race. The cpumask_and() sampling > cpuidle_mwait_flags can take a arbitrary period of time, and there's no > guarantee that the target CPUs are still in MWAIT when writing into > mwait_wakeup(cpu).

[PATCH 1/6] x86/idle: Remove broken MWAIT implementation

2025-07-02 Thread Andrew Cooper
cpuidle_wakeup_mwait() is a TOCTOU race. The cpumask_and() sampling cpuidle_mwait_flags can take a arbitrary period of time, and there's no guarantee that the target CPUs are still in MWAIT when writing into mwait_wakeup(cpu). The consequence of the race is that we'll fail to IPI targets. Also,