diff options
| author | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
|---|---|---|
| committer | Mark Brown <[email protected]> | 2015-10-12 18:09:27 +0100 | 
| commit | 79828b4fa835f73cdaf4bffa48696abdcbea9d02 (patch) | |
| tree | 5e0fa7156acb75ba603022bc807df8f2fedb97a8 /arch/x86/kernel/cpu/common.c | |
| parent | 721b51fcf91898299d96f4b72cb9434cda29dce6 (diff) | |
| parent | 8c1a9d6323abf0fb1e5dad96cf3f1c783505ea5a (diff) | |
Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-fix-rt5645
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 28 | 
1 files changed, 23 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 922c5e0cea4c..07ce52c22ec8 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -13,6 +13,7 @@  #include <linux/kgdb.h>  #include <linux/smp.h>  #include <linux/io.h> +#include <linux/syscore_ops.h>  #include <asm/stackprotector.h>  #include <asm/perf_event.h> @@ -1185,10 +1186,10 @@ void syscall_init(void)  	 * set CS/DS but only a 32bit target. LSTAR sets the 64bit rip.  	 */  	wrmsrl(MSR_STAR,  ((u64)__USER32_CS)<<48  | ((u64)__KERNEL_CS)<<32); -	wrmsrl(MSR_LSTAR, entry_SYSCALL_64); +	wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64);  #ifdef CONFIG_IA32_EMULATION -	wrmsrl(MSR_CSTAR, entry_SYSCALL_compat); +	wrmsrl(MSR_CSTAR, (unsigned long)entry_SYSCALL_compat);  	/*  	 * This only works on Intel CPUs.  	 * On AMD CPUs these MSRs are 32-bit, CPU truncates MSR_IA32_SYSENTER_EIP. @@ -1199,7 +1200,7 @@ void syscall_init(void)  	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);  	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat);  #else -	wrmsrl(MSR_CSTAR, ignore_sysret); +	wrmsrl(MSR_CSTAR, (unsigned long)ignore_sysret);  	wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG);  	wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL);  	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL); @@ -1410,7 +1411,7 @@ void cpu_init(void)  	load_sp0(t, ¤t->thread);  	set_tss_desc(cpu, t);  	load_TR_desc(); -	load_LDT(&init_mm.context); +	load_mm_ldt(&init_mm);  	clear_all_debug_regs();  	dbg_restore_debug_regs(); @@ -1459,7 +1460,7 @@ void cpu_init(void)  	load_sp0(t, thread);  	set_tss_desc(cpu, t);  	load_TR_desc(); -	load_LDT(&init_mm.context); +	load_mm_ldt(&init_mm);  	t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); @@ -1488,3 +1489,20 @@ inline bool __static_cpu_has_safe(u16 bit)  	return boot_cpu_has(bit);  }  EXPORT_SYMBOL_GPL(__static_cpu_has_safe); + +static void bsp_resume(void) +{ +	if (this_cpu->c_bsp_resume) +		this_cpu->c_bsp_resume(&boot_cpu_data); +} + +static struct syscore_ops cpu_syscore_ops = { +	.resume		= bsp_resume, +}; + +static int __init init_cpu_syscore(void) +{ +	register_syscore_ops(&cpu_syscore_ops); +	return 0; +} +core_initcall(init_cpu_syscore);  |