File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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)
20132013 int ret , i ;
20142014
20152015 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" ))
20182017 return SPECTRE_V2_CMD_NONE ;
20192018
20202019 ret = cmdline_find_option (boot_command_line , "spectre_v2" , arg , sizeof (arg ));
@@ -2286,8 +2285,11 @@ static void __init spectre_v2_select_mitigation(void)
22862285 case SPECTRE_V2_CMD_NONE :
22872286 return ;
22882287
2289- case SPECTRE_V2_CMD_FORCE :
22902288 case SPECTRE_V2_CMD_AUTO :
2289+ if (!should_mitigate_vuln (X86_BUG_SPECTRE_V2 ))
2290+ break ;
2291+ fallthrough ;
2292+ case SPECTRE_V2_CMD_FORCE :
22912293 if (boot_cpu_has (X86_FEATURE_IBRS_ENHANCED )) {
22922294 spectre_v2_enabled = SPECTRE_V2_EIBRS ;
22932295 break ;
@@ -2341,7 +2343,7 @@ static void __init spectre_v2_update_mitigation(void)
23412343 }
23422344 }
23432345
2344- if (boot_cpu_has_bug (X86_BUG_SPECTRE_V2 ) && ! cpu_mitigations_off () )
2346+ if (boot_cpu_has_bug (X86_BUG_SPECTRE_V2 ))
23452347 pr_info ("%s\n" , spectre_v2_strings [spectre_v2_enabled ]);
23462348}
23472349
You can’t perform that action at this time.
0 commit comments