Skip to content

Commit 47c2f29

Browse files
Fenghua YuH. Peter Anvin
authored andcommitted
x86/xsaves: Call booting time xsaves and xrstors in setup_init_fpu_buf
setup_init_fpu_buf() calls booting time xsaves and xrstors to save and restore xstate in xsave area. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Link: http://lkml.kernel.org/r/1401387164-43416-15-git-send-email-fenghua.yu@intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent f41d830 commit 47c2f29

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/x86/kernel/xsave.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,21 @@ static void __init setup_init_fpu_buf(void)
496496

497497
setup_xstate_features();
498498

499+
if (cpu_has_xsaves) {
500+
init_xstate_buf->xsave_hdr.xcomp_bv =
501+
(u64)1 << 63 | pcntxt_mask;
502+
init_xstate_buf->xsave_hdr.xstate_bv = pcntxt_mask;
503+
}
504+
499505
/*
500506
* Init all the features state with header_bv being 0x0
501507
*/
502-
xrstor_state(init_xstate_buf, -1);
508+
xrstor_state_booting(init_xstate_buf, -1);
503509
/*
504510
* Dump the init state again. This is to identify the init state
505511
* of any feature which is not represented by all zero's.
506512
*/
507-
xsave_state(init_xstate_buf, -1);
513+
xsave_state_booting(init_xstate_buf, -1);
508514
}
509515

510516
static enum { AUTO, ENABLE, DISABLE } eagerfpu = AUTO;

0 commit comments

Comments
 (0)