diff options
author | Mark Brown <broonie@kernel.org> | 2018-07-25 17:34:32 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-07-25 17:34:32 +0100 |
commit | 606b3effb9ce2ab6f67eeecace381c701d411ecf (patch) | |
tree | 2f9478b4cdd0703734c76570f61309b304de0933 /arch/x86/xen/suspend.c | |
parent | 1c6a1d5ae62dbaec8922761f56332e6e830b32a4 (diff) | |
parent | 762b585c492fedda1b0bc4c6d0a867307bf7cd0f (diff) |
Merge tag 'v4.4.144' into linux-linaro-lsk-v4.4lsk-v4.4-18.07
This is the 4.4.144 stable release
Diffstat (limited to 'arch/x86/xen/suspend.c')
-rw-r--r-- | arch/x86/xen/suspend.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index 7f664c416faf..4ecd0de08557 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c @@ -1,11 +1,14 @@ #include <linux/types.h> #include <linux/tick.h> +#include <linux/percpu-defs.h> #include <xen/xen.h> #include <xen/interface/xen.h> #include <xen/grant_table.h> #include <xen/events.h> +#include <asm/cpufeatures.h> +#include <asm/msr-index.h> #include <asm/xen/hypercall.h> #include <asm/xen/page.h> #include <asm/fixmap.h> @@ -68,6 +71,8 @@ static void xen_pv_post_suspend(int suspend_cancelled) xen_mm_unpin_all(); } +static DEFINE_PER_CPU(u64, spec_ctrl); + void xen_arch_pre_suspend(void) { if (xen_pv_domain()) @@ -84,6 +89,9 @@ void xen_arch_post_suspend(int cancelled) static void xen_vcpu_notify_restore(void *data) { + if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) + wrmsrl(MSR_IA32_SPEC_CTRL, this_cpu_read(spec_ctrl)); + /* Boot processor notified via generic timekeeping_resume() */ if (smp_processor_id() == 0) return; @@ -93,7 +101,15 @@ static void xen_vcpu_notify_restore(void *data) static void xen_vcpu_notify_suspend(void *data) { + u64 tmp; + tick_suspend_local(); + + if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) { + rdmsrl(MSR_IA32_SPEC_CTRL, tmp); + this_cpu_write(spec_ctrl, tmp); + wrmsrl(MSR_IA32_SPEC_CTRL, 0); + } } void xen_arch_resume(void) |