diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-24 10:02:32 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 15:47:33 +0200 |
commit | 9254aaa0fea4e8aa4e83539c379aecb41a975ca6 (patch) | |
tree | bdf4154a776bee05a54f58784f319bf0f81353b4 /arch/x86/power | |
parent | 84246fe4e3a0e412a9602983ba37f4e4dbebb3e8 (diff) |
x86/fpu: Move XCR0 manipulation to the FPU code proper
The suspend code accesses FPU state internals, add a helper for
it and isolate it.
Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/power')
-rw-r--r-- | arch/x86/power/cpu.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 62054acbd0d8..ad0ce6b70fac 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -18,10 +18,8 @@ #include <asm/mtrr.h> #include <asm/page.h> #include <asm/mce.h> -#include <asm/xcr.h> #include <asm/suspend.h> #include <asm/debugreg.h> -#include <asm/fpu/internal.h> /* xfeatures_mask */ #include <asm/cpu.h> #ifdef CONFIG_X86_32 @@ -155,6 +153,8 @@ static void fix_processor_context(void) #endif load_TR_desc(); /* This does ltr */ load_LDT(¤t->active_mm->context); /* This does lldt */ + + fpu__resume_cpu(); } /** @@ -221,12 +221,6 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); #endif - /* - * restore XCR0 for xsave capable cpu's. - */ - if (cpu_has_xsave) - xsetbv(XCR_XFEATURE_ENABLED_MASK, xfeatures_mask); - fix_processor_context(); do_fpu_end(); |