diff options
author | Fenghua Yu <fenghua.yu@intel.com> | 2014-05-29 14:12:42 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-05-29 17:33:06 -0400 |
commit | 47c2f292cc8669f70644a949cadd5fa5ee0e0e07 (patch) | |
tree | 6bbc5ede81eca14c21a445ae018dc874cb7fc97a /arch | |
parent | f41d830fa890044cb60f6bb39fc8f6493ffebb47 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/xsave.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index a4b451c6addf..8fa7c7d4183d 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c | |||
@@ -496,15 +496,21 @@ static void __init setup_init_fpu_buf(void) | |||
496 | 496 | ||
497 | setup_xstate_features(); | 497 | setup_xstate_features(); |
498 | 498 | ||
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 | |||
499 | /* | 505 | /* |
500 | * Init all the features state with header_bv being 0x0 | 506 | * Init all the features state with header_bv being 0x0 |
501 | */ | 507 | */ |
502 | xrstor_state(init_xstate_buf, -1); | 508 | xrstor_state_booting(init_xstate_buf, -1); |
503 | /* | 509 | /* |
504 | * Dump the init state again. This is to identify the init state | 510 | * Dump the init state again. This is to identify the init state |
505 | * of any feature which is not represented by all zero's. | 511 | * of any feature which is not represented by all zero's. |
506 | */ | 512 | */ |
507 | xsave_state(init_xstate_buf, -1); | 513 | xsave_state_booting(init_xstate_buf, -1); |
508 | } | 514 | } |
509 | 515 | ||
510 | static enum { AUTO, ENABLE, DISABLE } eagerfpu = AUTO; | 516 | static enum { AUTO, ENABLE, DISABLE } eagerfpu = AUTO; |