mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
x86/bugs: Add attack vector controls for TAA
Use attack vector controls to determine if TAA mitigation is required. Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250707183316.1349127-7-david.kaplan@amd.com
This commit is contained in:
parent
e3a88d4c06
commit
736565d4ed
|
|
@ -538,12 +538,13 @@ static void __init taa_select_mitigation(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (cpu_mitigations_off())
|
||||
taa_mitigation = TAA_MITIGATION_OFF;
|
||||
|
||||
/* Microcode will be checked in taa_update_mitigation(). */
|
||||
if (taa_mitigation == TAA_MITIGATION_AUTO)
|
||||
taa_mitigation = TAA_MITIGATION_VERW;
|
||||
if (taa_mitigation == TAA_MITIGATION_AUTO) {
|
||||
if (should_mitigate_vuln(X86_BUG_TAA))
|
||||
taa_mitigation = TAA_MITIGATION_VERW;
|
||||
else
|
||||
taa_mitigation = TAA_MITIGATION_OFF;
|
||||
}
|
||||
|
||||
if (taa_mitigation != TAA_MITIGATION_OFF)
|
||||
verw_clear_cpu_buf_mitigation_selected = true;
|
||||
|
|
@ -551,7 +552,7 @@ static void __init taa_select_mitigation(void)
|
|||
|
||||
static void __init taa_update_mitigation(void)
|
||||
{
|
||||
if (!taa_vulnerable() || cpu_mitigations_off())
|
||||
if (!taa_vulnerable())
|
||||
return;
|
||||
|
||||
if (verw_clear_cpu_buf_mitigation_selected)
|
||||
|
|
@ -592,7 +593,7 @@ 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 || smt_mitigations == SMT_MITIGATIONS_ON)
|
||||
cpu_smt_disable(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user