Re: x86/idle: Remove barriers for X86_BUG_CLFLUSH_MONITOR

From: Andrew Cooper
Date: Wed Apr 02 2025 - 10:04:30 EST


On 02/04/2025 3:01 pm, Dave Hansen wrote:
> On 4/2/25 02:10, Andrew Cooper wrote:
>> i.e. The SDM was incorrect at the time, and barriers should not have been
>> inserted. Double checking the original AAI65 errata (not available from
>> intel.com any more) shows no mention of barriers either.
> There's a near copy-and-paste of that code here:
>
>> static __cpuidle void mwait_idle(void)
>> {
>> if (!current_set_polling_and_test()) {
>> if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) {
>> mb(); /* quirk */
>> clflush((void *)&current_thread_info()->flags);
>> mb(); /* quirk */
>> }
> Any reason it can't get the same treatment?

Oh, yes that should get the same treatment.  (Sorry, too may cross-ports
between Xen and Linux trying to untangle this mess).

I'll submit a v2.

~Andrew