Commit 3a9c4b0d authored by Ingo Molnar's avatar Ingo Molnar

x86/fpu: Rename fpu_init() to fpu__cpu_init()

fpu_init() is a bit of a misnomer in that it (falsely) creates the
impression that it's related to the (old) fpu_finit() function,
which initializes FPU ctx state.

Rename it to fpu__cpu_init() to make its boot time initialization
clear, and to move it to the fpu__*() namespace.

Also fix and extend its comment block to point out that it's
called not only on the boot CPU, but on secondary CPUs as well.
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 c0ee2cf6
...@@ -39,7 +39,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig, ...@@ -39,7 +39,7 @@ int ia32_setup_frame(int sig, struct ksignal *ksig,
#endif #endif
extern unsigned int mxcsr_feature_mask; extern unsigned int mxcsr_feature_mask;
extern void fpu_init(void); extern void fpu__cpu_init(void);
extern void eager_fpu_init(void); extern void eager_fpu_init(void);
DECLARE_PER_CPU(struct task_struct *, fpu_owner_task); DECLARE_PER_CPU(struct task_struct *, fpu_owner_task);
......
...@@ -1439,7 +1439,7 @@ void cpu_init(void) ...@@ -1439,7 +1439,7 @@ void cpu_init(void)
clear_all_debug_regs(); clear_all_debug_regs();
dbg_restore_debug_regs(); dbg_restore_debug_regs();
fpu_init(); fpu__cpu_init();
if (is_uv_system()) if (is_uv_system())
uv_cpu_init(); uv_cpu_init();
...@@ -1495,7 +1495,7 @@ void cpu_init(void) ...@@ -1495,7 +1495,7 @@ void cpu_init(void)
clear_all_debug_regs(); clear_all_debug_regs();
dbg_restore_debug_regs(); dbg_restore_debug_regs();
fpu_init(); fpu__cpu_init();
} }
#endif #endif
......
...@@ -183,11 +183,13 @@ static void init_thread_xstate(void) ...@@ -183,11 +183,13 @@ static void init_thread_xstate(void)
} }
/* /*
* Called at bootup to set up the initial FPU state that is later cloned * Called on the boot CPU at bootup to set up the initial FPU state that
* into all processes. * is later cloned into all processes.
*
* Also called on secondary CPUs to set up the FPU state of their
* idle threads.
*/ */
void fpu__cpu_init(void)
void fpu_init(void)
{ {
unsigned long cr0; unsigned long cr0;
unsigned long cr4_mask = 0; unsigned long cr4_mask = 0;
......
...@@ -1423,7 +1423,7 @@ static void xen_pvh_set_cr_flags(int cpu) ...@@ -1423,7 +1423,7 @@ static void xen_pvh_set_cr_flags(int cpu)
return; return;
/* /*
* For BSP, PSE PGE are set in probe_page_size_mask(), for APs * For BSP, PSE PGE are set in probe_page_size_mask(), for APs
* set them here. For all, OSFXSR OSXMMEXCPT are set in fpu_init. * set them here. For all, OSFXSR OSXMMEXCPT are set in fpu__cpu_init().
*/ */
if (cpu_has_pse) if (cpu_has_pse)
cr4_set_bits_and_update_boot(X86_CR4_PSE); cr4_set_bits_and_update_boot(X86_CR4_PSE);
......
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