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

From: Josh Poimboeuf
Date: Tue Feb 11 2025 - 14:01:13 EST


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