Commit 2507e1c0 authored by Ingo Molnar's avatar Ingo Molnar

x86/fpu: Set up the legacy FPU init image from fpu__init_system()

The legacy FPU init image is used on older CPUs who don't run xstate init.
But the init code is called within setup_init_fpu_buf(), an xstate method.

Move this legacy init out of the xstate code and put it into fpu/init.c.
Reviewed-by: default avatarBorislav 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: default avatarIngo Molnar <mingo@kernel.org>
parent 429ced50
...@@ -158,6 +158,12 @@ void fpu__init_system(void) ...@@ -158,6 +158,12 @@ void fpu__init_system(void)
/* The FPU has to be operational for some of the later FPU init activities: */ /* The FPU has to be operational for some of the later FPU init activities: */
fpu__init_cpu(); fpu__init_cpu();
/*
* Set up the legacy init FPU context. (xstate init might overwrite this
* with a more modern format, if the CPU supports it.)
*/
fx_finit(&init_xstate_ctx.i387);
mxcsr_feature_mask_init(); mxcsr_feature_mask_init();
fpu__init_system_xstate(); fpu__init_system_xstate();
eager_fpu_init(); eager_fpu_init();
......
...@@ -576,12 +576,6 @@ static void setup_init_fpu_buf(void) ...@@ -576,12 +576,6 @@ static void setup_init_fpu_buf(void)
return; return;
on_boot_cpu = 0; on_boot_cpu = 0;
/*
* Setup init_xstate_ctx to represent the init state of
* all the features managed by the xsave
*/
fx_finit(&init_xstate_ctx.i387);
if (!cpu_has_xsave) if (!cpu_has_xsave)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment