Skip to content

Commit 56aa4d2

Browse files
jpoimboesuryasaimadhu
authored andcommitted
x86/speculation: Fix SPEC_CTRL write on SMT state change
If the SMT state changes, SSBD might get accidentally disabled. Fix that. Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]>
1 parent e6aa136 commit 56aa4d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,8 @@ static void __init spectre_v2_select_mitigation(void)
14581458

14591459
static void update_stibp_msr(void * __unused)
14601460
{
1461-
write_spec_ctrl_current(x86_spec_ctrl_base, true);
1461+
u64 val = spec_ctrl_current() | (x86_spec_ctrl_base & SPEC_CTRL_STIBP);
1462+
write_spec_ctrl_current(val, true);
14621463
}
14631464

14641465
/* Update x86_spec_ctrl_base in case SMT state changed. */

0 commit comments

Comments
 (0)