aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/xsave.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-07-21 13:03:52 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-21 17:06:04 -0400
commit0e49bf66d2ca649b167428adddbbbe9d9bd4894c (patch)
tree741f170dbb160ece127b2ab497f9fc9d1e3bd1bc /arch/x86/kernel/xsave.c
parent82d4150cec83b9775f84810b39a1c0b91585d429 (diff)
x86, xsave: Separate fpu and xsave initialization
As xsave also supports other than fpu features, it should be initialized independently of the fpu. This patch moves this out of fpu initialization. There is also a lot of cross referencing between fpu and xsave code. This patch reduces this by making xsave_cntxt_init() and init_thread_xstate() static functions. The patch moves the cpu_has_xsave check at the beginning of xsave_init(). All other checks may removed then. Signed-off-by: Robert Richter <robert.richter@amd.com> LKML-Reference: <1279731838-1522-2-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/xsave.c')
-rw-r--r--arch/x86/kernel/xsave.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index ab9ad48b6530..550bf45236f4 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -362,9 +362,6 @@ unsigned int sig_xstate_size = sizeof(struct _fpstate);
362 */ 362 */
363static void __cpuinit __xsave_init(void) 363static void __cpuinit __xsave_init(void)
364{ 364{
365 if (!cpu_has_xsave)
366 return;
367
368 set_in_cr4(X86_CR4_OSXSAVE); 365 set_in_cr4(X86_CR4_OSXSAVE);
369 366
370 /* 367 /*
@@ -429,7 +426,7 @@ static void __init setup_xstate_init(void)
429/* 426/*
430 * Enable and initialize the xsave feature. 427 * Enable and initialize the xsave feature.
431 */ 428 */
432void __ref xsave_cntxt_init(void) 429static void __cpuinit xsave_cntxt_init(void)
433{ 430{
434 unsigned int eax, ebx, ecx, edx; 431 unsigned int eax, ebx, ecx, edx;
435 432
@@ -466,10 +463,13 @@ void __ref xsave_cntxt_init(void)
466 463
467void __cpuinit xsave_init(void) 464void __cpuinit xsave_init(void)
468{ 465{
466 if (!cpu_has_xsave)
467 return;
468
469 /* 469 /*
470 * Boot processor to setup the FP and extended state context info. 470 * Boot processor to setup the FP and extended state context info.
471 */ 471 */
472 if (!smp_processor_id()) 472 if (!smp_processor_id())
473 init_thread_xstate(); 473 xsave_cntxt_init();
474 __xsave_init(); 474 __xsave_init();
475} 475}