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>
This commit is contained in:
Robert Richter
2010-07-21 19:03:52 +02:00
committed by H. Peter Anvin
parent 82d4150cec
commit 0e49bf66d2
5 changed files with 26 additions and 15 deletions

View File

@@ -362,9 +362,6 @@ unsigned int sig_xstate_size = sizeof(struct _fpstate);
*/
static void __cpuinit __xsave_init(void)
{
if (!cpu_has_xsave)
return;
set_in_cr4(X86_CR4_OSXSAVE);
/*
@@ -429,7 +426,7 @@ static void __init setup_xstate_init(void)
/*
* Enable and initialize the xsave feature.
*/
void __ref xsave_cntxt_init(void)
static void __cpuinit xsave_cntxt_init(void)
{
unsigned int eax, ebx, ecx, edx;
@@ -466,10 +463,13 @@ void __ref xsave_cntxt_init(void)
void __cpuinit xsave_init(void)
{
if (!cpu_has_xsave)
return;
/*
* Boot processor to setup the FP and extended state context info.
*/
if (!smp_processor_id())
init_thread_xstate();
xsave_cntxt_init();
__xsave_init();
}