Commit 064e51e3 authored by Ingo Molnar's avatar Ingo Molnar

x86/fpu: Clean up eager_fpu_init() and rename it to fpu__ctx_switch_init()

It's not an xsave specific function anymore, so rename it accordingly
and also clean it up a bit:

 - remove the obsolete __init_refok, as the code paths are not
   mixed anymore

 - rename it from eager_fpu_init() to fpu__ctx_switch_init()

 - remove stray 'return;'

 - make it static to its only user
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 6f5d265a
...@@ -167,7 +167,7 @@ __setup("eagerfpu=", eager_fpu_setup); ...@@ -167,7 +167,7 @@ __setup("eagerfpu=", eager_fpu_setup);
* setup_init_fpu_buf() is __init and it is OK to call it here because * setup_init_fpu_buf() is __init and it is OK to call it here because
* init_xstate_ctx will be unset only once during boot. * init_xstate_ctx will be unset only once during boot.
*/ */
void __init_refok eager_fpu_init(void) static void fpu__ctx_switch_init(void)
{ {
WARN_ON(current->thread.fpu.fpstate_active); WARN_ON(current->thread.fpu.fpstate_active);
current_thread_info()->status = 0; current_thread_info()->status = 0;
...@@ -191,10 +191,8 @@ void __init_refok eager_fpu_init(void) ...@@ -191,10 +191,8 @@ void __init_refok eager_fpu_init(void)
printk_once(KERN_INFO "x86/fpu: Using '%s' FPU context switches.\n", eagerfpu == ENABLE ? "eager" : "lazy"); printk_once(KERN_INFO "x86/fpu: Using '%s' FPU context switches.\n", eagerfpu == ENABLE ? "eager" : "lazy");
if (!cpu_has_eager_fpu) { if (!cpu_has_eager_fpu)
stts(); stts();
return;
}
} }
/* /*
...@@ -214,7 +212,7 @@ void fpu__init_system(void) ...@@ -214,7 +212,7 @@ void fpu__init_system(void)
mxcsr_feature_mask_init(); mxcsr_feature_mask_init();
fpu__init_system_xstate(); fpu__init_system_xstate();
eager_fpu_init(); fpu__ctx_switch_init();
} }
void fpu__cpu_init(void) void fpu__cpu_init(void)
......
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