Re: [PATCH v3 23/35] x86/bugs: Add attack vector controls for taa

Josh Poimboeuf
2025-02-11T19:01:04Z

On Wed, Jan 08, 2025 at 02:25:03PM -0600, David Kaplan wrote:
> @@ -620,7 +624,8 @@ static void __init taa_apply_mitigation(void)
> */
> setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF);
>
> - if (taa_nosmt || cpu_mitigations_auto_nosmt())
> + if (taa_nosmt || cpu_mitigations_auto_nosmt() ||
> + cpu_mitigate_attack_vector(CPU_MITIGATE_CROSS_THREAD))
> cpu_smt_disable(false);

There's a huge overlap between cpu_mitigations_auto_nosmt() and
CPU_MITIGATE_CROSS_THREAD.

IIUC, the main difference is that cpu_mitigations_auto_nosmt() selects
all the vectors whereas mitigate_cross_thread=on can be combined with
individual vectors.

Maybe we need a should_disable_smt() helper which checks both?

--
Josh