Commit 7fc253e2 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Ingo Molnar

x86/fpu: Kill eager_fpu_init_bp()

Now that eager_fpu_init_bp() does setup_init_fpu_buf() only and
nothing else, we can remove it and move this code into its "caller",
eager_fpu_init().

This avoids the confusing games with "static __refdata void (*boot_func)":

init_xstate_buf can be NULL only during boot, so it is safe to call the
__init-annotated setup_init_fpu_buf() function in eager_fpu_init(), we
just need to mark it as __init_refok.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pekka Riikonen <priikone@iki.fi>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Link: http://lkml.kernel.org/r/20150314151334.GC13029@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 4bd5bf8c
...@@ -678,16 +678,12 @@ void xsave_init(void) ...@@ -678,16 +678,12 @@ void xsave_init(void)
this_func(); this_func();
} }
static inline void __init eager_fpu_init_bp(void) /*
{ * setup_init_fpu_buf() is __init and it is OK to call it here because
if (!init_xstate_buf) * init_xstate_buf will be unset only once during boot.
setup_init_fpu_buf(); */
} void __init_refok eager_fpu_init(void)
void eager_fpu_init(void)
{ {
static __refdata void (*boot_func)(void) = eager_fpu_init_bp;
WARN_ON(used_math()); WARN_ON(used_math());
current_thread_info()->status = 0; current_thread_info()->status = 0;
...@@ -699,10 +695,8 @@ void eager_fpu_init(void) ...@@ -699,10 +695,8 @@ void eager_fpu_init(void)
return; return;
} }
if (boot_func) { if (!init_xstate_buf)
boot_func(); setup_init_fpu_buf();
boot_func = NULL;
}
} }
/* /*
......
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