x86/fpu: Make setup_init_fpu_buf() run-once explicitly

Remove the dependency on the init_xstate_buf == NULL check to
implement once-per-bootup logic in eager_fpu_init(), by making
setup_init_fpu_buf() run once per bootup explicitly.

This is in preparation to make init_xstate_buf statically
allocated.

The various boot-once quirks in the FPU init code will be removed
in a later cleanup stage.

Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2015-04-25 05:27:26 +02:00
parent 966ece619e
commit 26b1f5d05a
1 changed files with 8 additions and 3 deletions

View File

@ -565,8 +565,14 @@ void setup_xstate_comp(void)
/*
* setup the xstate image representing the init state
*/
static void __init setup_init_fpu_buf(void)
static void setup_init_fpu_buf(void)
{
static int on_boot_cpu = 1;
if (!on_boot_cpu)
return;
on_boot_cpu = 0;
/*
* Setup init_xstate_buf to represent the init state of
* all the features managed by the xsave
@ -738,8 +744,7 @@ void __init_refok eager_fpu_init(void)
return;
}
if (!init_xstate_buf)
setup_init_fpu_buf();
setup_init_fpu_buf();
}
/*