Re: [PATCH v3 30/35] x86/bugs: Add attack vector controls for spectre_v2_user

Josh Poimboeuf
2025-02-11T19:03:13Z

On Wed, Jan 08, 2025 at 02:25:10PM -0600, David Kaplan wrote:
> @@ -1614,6 +1614,13 @@ spectre_v2_user_select_mitigation(void)
> spectre_v2_user_stibp = SPECTRE_V2_USER_STRICT;
> break;
> case SPECTRE_V2_USER_CMD_AUTO:
> + if (should_mitigate_vuln(X86_BUG_SPECTRE_V2_USER)) {
> + spectre_v2_user_ibpb = SPECTRE_V2_USER_PRCTL;
> + spectre_v2_user_stibp = SPECTRE_V2_USER_PRCTL;
> + } else {
> + return;
> + }
> + break;

Can just fallthrough in the should_mitigate_vuln() case?

> case SPECTRE_V2_USER_CMD_PRCTL:
> spectre_v2_user_ibpb = SPECTRE_V2_USER_PRCTL;
> spectre_v2_user_stibp = SPECTRE_V2_USER_PRCTL;

--
Josh