aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2014-05-29 14:12:41 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2014-05-29 17:33:04 -0400
commitf41d830fa890044cb60f6bb39fc8f6493ffebb47 (patch)
tree1beb0fb5a035dbb4aecebc4edda386ddbfa68d03 /arch
parentadb9d526e98268b647a74726346e1c40e6a37d2e (diff)
x86/xsaves: Save xstate to task's xsave area in __save_fpu during booting time
__save_fpu() can be called during early booting time when cpu caps are not enabled and alternative can not be used yet. Therefore, it calls xsave_state_booting() during booting time to save xstate to task's xsave area. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Link: http://lkml.kernel.org/r/1401387164-43416-14-git-send-email-fenghua.yu@intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/fpu-internal.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index cea1c76d49bf..6099c0e5b62e 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -508,9 +508,12 @@ static inline void user_fpu_begin(void)
508 508
509static inline void __save_fpu(struct task_struct *tsk) 509static inline void __save_fpu(struct task_struct *tsk)
510{ 510{
511 if (use_xsave()) 511 if (use_xsave()) {
512 xsave_state(&tsk->thread.fpu.state->xsave, -1); 512 if (unlikely(system_state == SYSTEM_BOOTING))
513 else 513 xsave_state_booting(&tsk->thread.fpu.state->xsave, -1);
514 else
515 xsave_state(&tsk->thread.fpu.state->xsave, -1);
516 } else
514 fpu_fxsave(&tsk->thread.fpu); 517 fpu_fxsave(&tsk->thread.fpu);
515} 518}
516 519