@@ -52,6 +52,7 @@ extern enum split_lock_detect_state get_split_lock_detect_state(void);
extern void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c);
extern void switch_to_sld(unsigned long tifn);
extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
+extern void split_lock_detect_set(bool on);
#else
static inline enum split_lock_detect_state get_split_lock_detect_state(void)
{
@@ -1088,6 +1088,12 @@ void switch_to_sld(unsigned long tifn)
__sld_msr_set(!(tifn & _TIF_SLD));
}
+void split_lock_detect_set(bool on)
+{
+ __sld_msr_set(on);
+}
+EXPORT_SYMBOL_GPL(split_lock_detect_set);
+
#define SPLIT_LOCK_CPU(model) {X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY}
/*
Add and export split_lock_detect_set(), which will be used by KVM module to change the MSR_TEST_CTRL.SPLIT_LOCK_DETECT bit to switch SLD. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> --- arch/x86/include/asm/cpu.h | 1 + arch/x86/kernel/cpu/intel.c | 6 ++++++ 2 files changed, 7 insertions(+)