diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-26 14:35:54 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 15:47:45 +0200 |
commit | 7218e8b723dc9ceb71cf2fbd3d019e9e11b7d3cf (patch) | |
tree | 122bffbcc238c00125c43e95aa8f576c6b25096f | |
parent | b11316ed9ed9e453562d9f89a39d344331a3ec1d (diff) | |
download | op-kernel-dev-7218e8b723dc9ceb71cf2fbd3d019e9e11b7d3cf.zip op-kernel-dev-7218e8b723dc9ceb71cf2fbd3d019e9e11b7d3cf.tar.gz |
x86/fpu: Factor out fpu__init_system_generic()
Factor out the generic bits from fpu__init_system().
Rename mxcsr_feature_mask_init() to fpu__init_system_mxcsr()
to bring it in line with the rest of the nomenclature.
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>
-rw-r--r-- | arch/x86/kernel/fpu/init.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 37e8b13..c3f3a89c 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -72,7 +72,7 @@ unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; unsigned int xstate_size; EXPORT_SYMBOL_GPL(xstate_size); -static void mxcsr_feature_mask_init(void) +static void fpu__init_system_mxcsr(void) { unsigned int mask = 0; @@ -94,6 +94,20 @@ static void mxcsr_feature_mask_init(void) mxcsr_feature_mask &= mask; } +/* + * Once per bootup FPU initialization sequences that will run on most x86 CPUs: + */ +static void fpu__init_system_generic(void) +{ + /* + * 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); + + fpu__init_system_mxcsr(); +} + static void fpstate_xstate_init_size(void) { static bool on_boot_cpu = 1; @@ -230,18 +244,11 @@ void fpu__init_system(void) /* * But don't leave CR0::TS set yet, as some of the FPU setup methods depend * on being able to execute FPU instructions that will fault on a set TS, - * such as the FXSAVE in mxcsr_feature_mask_init(). + * such as the FXSAVE in fpu__init_system_mxcsr(). */ clts(); - /* - * 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(); - + fpu__init_system_generic(); fpstate_xstate_init_size(); fpu__init_system_xstate(); |