Skip to content

Commit f41d830

Browse files
Fenghua YuH. Peter Anvin
authored andcommitted
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>
1 parent adb9d52 commit f41d830

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arch/x86/include/asm/fpu-internal.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,12 @@ static inline void user_fpu_begin(void)
508508

509509
static inline void __save_fpu(struct task_struct *tsk)
510510
{
511-
if (use_xsave())
512-
xsave_state(&tsk->thread.fpu.state->xsave, -1);
513-
else
511+
if (use_xsave()) {
512+
if (unlikely(system_state == SYSTEM_BOOTING))
513+
xsave_state_booting(&tsk->thread.fpu.state->xsave, -1);
514+
else
515+
xsave_state(&tsk->thread.fpu.state->xsave, -1);
516+
} else
514517
fpu_fxsave(&tsk->thread.fpu);
515518
}
516519

0 commit comments

Comments
 (0)