Re: [PATCH v2] x86/idle: Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR

From: Dave Hansen
Date: Wed Apr 02 2025 - 13:39:54 EST


On 4/2/25 10:24, 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.
>
> Note: If this were a general codepath, the MFENCEs would be needed, because
> AMD CPUs of the same vintage do sport otherwise-unordered CLFLUSHs.
>
> Furthermore, use a plain alternative, rather than static_cpu_has_bug() and/or
> no optimisation. The workaround is a single instruction.

Nit: this never comes out and says that it removes the unnecessary
barriers. But we can fix that up when we apply this by adding:

Remove the unnecessary barriers. Furthermore, use a plain
alternative, rather than static_cpu_has_bug() and/or
no optimisation. The workaround is a single instruction.

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>