Skip to content

Commit

Permalink
x86/xsaves: Call booting time xsaves and xrstors in setup_init_fpu_buf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fenghua Yu authored and H. Peter Anvin committed May 29, 2014
1 parent f41d830 commit 47c2f29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arch/x86/kernel/xsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,21 @@ static void __init setup_init_fpu_buf(void)

setup_xstate_features();

if (cpu_has_xsaves) {
init_xstate_buf->xsave_hdr.xcomp_bv =
(u64)1 << 63 | pcntxt_mask;
init_xstate_buf->xsave_hdr.xstate_bv = pcntxt_mask;
}

/*
* Init all the features state with header_bv being 0x0
*/
xrstor_state(init_xstate_buf, -1);
xrstor_state_booting(init_xstate_buf, -1);
/*
* Dump the init state again. This is to identify the init state
* of any feature which is not represented by all zero's.
*/
xsave_state(init_xstate_buf, -1);
xsave_state_booting(init_xstate_buf, -1);
}

static enum { AUTO, ENABLE, DISABLE } eagerfpu = AUTO;
Expand Down

0 comments on commit 47c2f29

Please sign in to comment.