File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1518,13 +1518,17 @@ early_param("indirect_target_selection", its_parse_cmdline);
15181518
15191519static void __init its_select_mitigation (void )
15201520{
1521- if (!boot_cpu_has_bug (X86_BUG_ITS ) || cpu_mitigations_off () ) {
1521+ if (!boot_cpu_has_bug (X86_BUG_ITS )) {
15221522 its_mitigation = ITS_MITIGATION_OFF ;
15231523 return ;
15241524 }
15251525
1526- if (its_mitigation == ITS_MITIGATION_AUTO )
1527- its_mitigation = ITS_MITIGATION_ALIGNED_THUNKS ;
1526+ if (its_mitigation == ITS_MITIGATION_AUTO ) {
1527+ if (should_mitigate_vuln (X86_BUG_ITS ))
1528+ its_mitigation = ITS_MITIGATION_ALIGNED_THUNKS ;
1529+ else
1530+ its_mitigation = ITS_MITIGATION_OFF ;
1531+ }
15281532
15291533 if (its_mitigation == ITS_MITIGATION_OFF )
15301534 return ;
@@ -1555,12 +1559,13 @@ static void __init its_select_mitigation(void)
15551559
15561560static void __init its_update_mitigation (void )
15571561{
1558- if (!boot_cpu_has_bug (X86_BUG_ITS ) || cpu_mitigations_off () )
1562+ if (!boot_cpu_has_bug (X86_BUG_ITS ))
15591563 return ;
15601564
15611565 switch (spectre_v2_enabled ) {
15621566 case SPECTRE_V2_NONE :
1563- pr_err ("WARNING: Spectre-v2 mitigation is off, disabling ITS\n" );
1567+ if (its_mitigation != ITS_MITIGATION_OFF )
1568+ pr_err ("WARNING: Spectre-v2 mitigation is off, disabling ITS\n" );
15641569 its_mitigation = ITS_MITIGATION_OFF ;
15651570 break ;
15661571 case SPECTRE_V2_RETPOLINE :
You can’t perform that action at this time.
0 commit comments