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);
1518
1518
1519
1519
static void __init its_select_mitigation (void )
1520
1520
{
1521
- if (!boot_cpu_has_bug (X86_BUG_ITS ) || cpu_mitigations_off () ) {
1521
+ if (!boot_cpu_has_bug (X86_BUG_ITS )) {
1522
1522
its_mitigation = ITS_MITIGATION_OFF ;
1523
1523
return ;
1524
1524
}
1525
1525
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
+ }
1528
1532
1529
1533
if (its_mitigation == ITS_MITIGATION_OFF )
1530
1534
return ;
@@ -1555,12 +1559,13 @@ static void __init its_select_mitigation(void)
1555
1559
1556
1560
static void __init its_update_mitigation (void )
1557
1561
{
1558
- if (!boot_cpu_has_bug (X86_BUG_ITS ) || cpu_mitigations_off () )
1562
+ if (!boot_cpu_has_bug (X86_BUG_ITS ))
1559
1563
return ;
1560
1564
1561
1565
switch (spectre_v2_enabled ) {
1562
1566
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" );
1564
1569
its_mitigation = ITS_MITIGATION_OFF ;
1565
1570
break ;
1566
1571
case SPECTRE_V2_RETPOLINE :
You can’t perform that action at this time.
0 commit comments