diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-06-15 00:15:54 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-06-27 11:33:59 +0300 |
commit | c779bc1a9002fa474175b80e72b85c9bf628abb0 (patch) | |
tree | e79fbab2ca5f15aad4a76200cd56c6ae899dfd67 /arch/x86/kernel/process.c | |
parent | 2dbb887e875b1de3ca8f40ddf26bcfe55798c609 (diff) | |
download | linux-c779bc1a9002fa474175b80e72b85c9bf628abb0.tar.xz |
x86/bugs: Optimize SPEC_CTRL MSR writes
When changing SPEC_CTRL for user control, the WRMSR can be delayed
until return-to-user when KERNEL_IBRS has been enabled.
This avoids an MSR write during context switch.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 05611f66d013..d456ce21c255 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -600,7 +600,7 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp, } if (updmsr) - write_spec_ctrl_current(msr); + write_spec_ctrl_current(msr, false); } static unsigned long speculation_ctrl_update_tif(struct task_struct *tsk) |