File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2013,8 +2013,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
2013
2013
int ret , i ;
2014
2014
2015
2015
cmd = IS_ENABLED (CONFIG_MITIGATION_SPECTRE_V2 ) ? SPECTRE_V2_CMD_AUTO : SPECTRE_V2_CMD_NONE ;
2016
- if (cmdline_find_option_bool (boot_command_line , "nospectre_v2" ) ||
2017
- cpu_mitigations_off ())
2016
+ if (cmdline_find_option_bool (boot_command_line , "nospectre_v2" ))
2018
2017
return SPECTRE_V2_CMD_NONE ;
2019
2018
2020
2019
ret = cmdline_find_option (boot_command_line , "spectre_v2" , arg , sizeof (arg ));
@@ -2286,8 +2285,11 @@ static void __init spectre_v2_select_mitigation(void)
2286
2285
case SPECTRE_V2_CMD_NONE :
2287
2286
return ;
2288
2287
2289
- case SPECTRE_V2_CMD_FORCE :
2290
2288
case SPECTRE_V2_CMD_AUTO :
2289
+ if (!should_mitigate_vuln (X86_BUG_SPECTRE_V2 ))
2290
+ break ;
2291
+ fallthrough ;
2292
+ case SPECTRE_V2_CMD_FORCE :
2291
2293
if (boot_cpu_has (X86_FEATURE_IBRS_ENHANCED )) {
2292
2294
spectre_v2_enabled = SPECTRE_V2_EIBRS ;
2293
2295
break ;
@@ -2341,7 +2343,7 @@ static void __init spectre_v2_update_mitigation(void)
2341
2343
}
2342
2344
}
2343
2345
2344
- if (boot_cpu_has_bug (X86_BUG_SPECTRE_V2 ) && ! cpu_mitigations_off () )
2346
+ if (boot_cpu_has_bug (X86_BUG_SPECTRE_V2 ))
2345
2347
pr_info ("%s\n" , spectre_v2_strings [spectre_v2_enabled ]);
2346
2348
}
2347
2349
You can’t perform that action at this time.
0 commit comments