aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/i387.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-07-29 13:29:19 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-30 13:49:24 -0400
commitdc1e35c6e95e8923cf1d3510438b63c600fee1e2 (patch)
tree4348f51f1bfdd124efd6d16dcc552bd4a148fdfb /arch/x86/kernel/i387.c
parenta648bf4632628c787abb0514277f2a231fca39ca (diff)
x86, xsave: enable xsave/xrstor on cpus with xsave support
Enables xsave/xrstor by turning on cr4.osxsave on cpu's which have the xsave support. For now, features that OS supports/enabled are FP and SSE. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/i387.c')
-rw-r--r--arch/x86/kernel/i387.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index eb9ddd8efb82..e22a9a9dce8a 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -61,6 +61,11 @@ void __init init_thread_xstate(void)
61 return; 61 return;
62 } 62 }
63 63
64 if (cpu_has_xsave) {
65 xsave_cntxt_init();
66 return;
67 }
68
64 if (cpu_has_fxsr) 69 if (cpu_has_fxsr)
65 xstate_size = sizeof(struct i387_fxsave_struct); 70 xstate_size = sizeof(struct i387_fxsave_struct);
66#ifdef CONFIG_X86_32 71#ifdef CONFIG_X86_32
@@ -83,6 +88,13 @@ void __cpuinit fpu_init(void)
83 88
84 write_cr0(oldcr0 & ~(X86_CR0_TS|X86_CR0_EM)); /* clear TS and EM */ 89 write_cr0(oldcr0 & ~(X86_CR0_TS|X86_CR0_EM)); /* clear TS and EM */
85 90
91 /*
92 * Boot processor to setup the FP and extended state context info.
93 */
94 if (!smp_processor_id())
95 init_thread_xstate();
96 xsave_init();
97
86 mxcsr_feature_mask_init(); 98 mxcsr_feature_mask_init();
87 /* clean state in init */ 99 /* clean state in init */
88 current_thread_info()->status = 0; 100 current_thread_info()->status = 0;