aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-07-20 14:50:51 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-20 19:21:44 -0400
commit82d4150cec83b9775f84810b39a1c0b91585d429 (patch)
treef4e92af289f3d09c0a9fbc62e91e103f3625073e /arch/x86/kernel
parentdb10db48b2c530def21bfd76d576702c7df7f620 (diff)
x86, xsave: Move boot cpu initialization to xsave_init()
This patch moves boot cpu initialization to xsave_init(). Now all cpus are initialized in one single function. Signed-off-by: Robert Richter <robert.richter@amd.com> LKML-Reference: <1279651857-24639-5-git-send-email-robert.richter@amd.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/common.c6
-rw-r--r--arch/x86/kernel/i387.c5
-rw-r--r--arch/x86/kernel/xsave.c14
3 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 26804b2986b8..40561085d4f3 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1270,12 +1270,6 @@ void __cpuinit cpu_init(void)
1270 clear_used_math(); 1270 clear_used_math();
1271 mxcsr_feature_mask_init(); 1271 mxcsr_feature_mask_init();
1272 1272
1273 /*
1274 * Boot processor to setup the FP and extended state context info.
1275 */
1276 if (!smp_processor_id())
1277 init_thread_xstate();
1278
1279 xsave_init(); 1273 xsave_init();
1280} 1274}
1281#endif 1275#endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 6106af9fd129..2f32ef05f10e 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -93,11 +93,6 @@ void __cpuinit fpu_init(void)
93 93
94 write_cr0(oldcr0 & ~(X86_CR0_TS|X86_CR0_EM)); /* clear TS and EM */ 94 write_cr0(oldcr0 & ~(X86_CR0_TS|X86_CR0_EM)); /* clear TS and EM */
95 95
96 /*
97 * Boot processor to setup the FP and extended state context info.
98 */
99 if (!smp_processor_id())
100 init_thread_xstate();
101 xsave_init(); 96 xsave_init();
102 97
103 mxcsr_feature_mask_init(); 98 mxcsr_feature_mask_init();
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 368047c8d507..ab9ad48b6530 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -360,7 +360,7 @@ unsigned int sig_xstate_size = sizeof(struct _fpstate);
360/* 360/*
361 * Enable the extended processor state save/restore feature 361 * Enable the extended processor state save/restore feature
362 */ 362 */
363void __cpuinit xsave_init(void) 363static void __cpuinit __xsave_init(void)
364{ 364{
365 if (!cpu_has_xsave) 365 if (!cpu_has_xsave)
366 return; 366 return;
@@ -446,7 +446,7 @@ void __ref xsave_cntxt_init(void)
446 * Support only the state known to OS. 446 * Support only the state known to OS.
447 */ 447 */
448 pcntxt_mask = pcntxt_mask & XCNTXT_MASK; 448 pcntxt_mask = pcntxt_mask & XCNTXT_MASK;
449 xsave_init(); 449 __xsave_init();
450 450
451 /* 451 /*
452 * Recompute the context size for enabled features 452 * Recompute the context size for enabled features
@@ -463,3 +463,13 @@ void __ref xsave_cntxt_init(void)
463 "cntxt size 0x%x\n", 463 "cntxt size 0x%x\n",
464 pcntxt_mask, xstate_size); 464 pcntxt_mask, xstate_size);
465} 465}
466
467void __cpuinit xsave_init(void)
468{
469 /*
470 * Boot processor to setup the FP and extended state context info.
471 */
472 if (!smp_processor_id())
473 init_thread_xstate();
474 __xsave_init();
475}