summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11fb068)
raw | patch | inline | side by side (parent: 11fb068)
author | Thomas Gleixner <tglx@linutronix.de> | |
Thu, 10 May 2018 18:31:44 +0000 (20:31 +0200) | ||
committer | Thomas Gleixner <tglx@linutronix.de> | |
Thu, 17 May 2018 15:09:19 +0000 (17:09 +0200) |
The upcoming support for the virtual SPEC_CTRL MSR on AMD needs to reuse
speculative_store_bypass_update() to avoid code duplication. Add an
argument for supplying a thread info (TIF) value and create a wrapper
speculative_store_bypass_update_current() which is used at the existing
call site.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
speculative_store_bypass_update() to avoid code duplication. Add an
argument for supplying a thread info (TIF) value and create a wrapper
speculative_store_bypass_update_current() which is used at the existing
call site.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/include/asm/spec-ctrl.h | patch | blob | history | |
arch/x86/kernel/cpu/bugs.c | patch | blob | history | |
arch/x86/kernel/process.c | patch | blob | history |
index 6e2874049afdc8cf3785845f778f7169eb8d064a..82b6c5a0d61e057d271e9131536494709402d0d5 100644 (file)
static inline void speculative_store_bypass_ht_init(void) { }
#endif
-extern void speculative_store_bypass_update(void);
+extern void speculative_store_bypass_update(unsigned long tif);
+
+static inline void speculative_store_bypass_update_current(void)
+{
+ speculative_store_bypass_update(current_thread_info()->flags);
+}
#endif
index 82422a04b5066c1b77ca052c700928466f499a59..f2f0c1b3bf50a3ccaa55f5b0c8588bc3dab9c155 100644 (file)
* mitigation until it is next scheduled.
*/
if (task == current && update)
- speculative_store_bypass_update();
+ speculative_store_bypass_update_current();
return 0;
}
index 91c3398286d84e69a4c752027f10e6f78b29f6c1..30ca2d1a92319726ff31d3ddb8264140bcec17cf 100644 (file)
@@ -414,10 +414,10 @@ static __always_inline void __speculative_store_bypass_update(unsigned long tifn
intel_set_ssb_state(tifn);
}
-void speculative_store_bypass_update(void)
+void speculative_store_bypass_update(unsigned long tif)
{
preempt_disable();
- __speculative_store_bypass_update(current_thread_info()->flags);
+ __speculative_store_bypass_update(tif);
preempt_enable();
}