aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/xsave.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2015-03-14 11:13:34 -0400
committerIngo Molnar <mingo@kernel.org>2015-03-23 05:14:00 -0400
commit7fc253e277ecf1ea57c2d670bdbcda3dffd19453 (patch)
tree8dbbac77caef39b26171ca09d2132e33db1ad43d /arch/x86/kernel/xsave.c
parent4bd5bf8c85e6bca5be9e7c4b3d7ad1942ae323f3 (diff)
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: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Borislav 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.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/xsave.c')
-rw-r--r--arch/x86/kernel/xsave.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index ada8df7b89c0..87a815b85f3e 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -678,16 +678,12 @@ void xsave_init(void)
678 this_func(); 678 this_func();
679} 679}
680 680
681static inline void __init eager_fpu_init_bp(void) 681/*
682{ 682 * setup_init_fpu_buf() is __init and it is OK to call it here because
683 if (!init_xstate_buf) 683 * init_xstate_buf will be unset only once during boot.
684 setup_init_fpu_buf(); 684 */
685} 685void __init_refok eager_fpu_init(void)
686
687void eager_fpu_init(void)
688{ 686{
689 static __refdata void (*boot_func)(void) = eager_fpu_init_bp;
690
691 WARN_ON(used_math()); 687 WARN_ON(used_math());
692 current_thread_info()->status = 0; 688 current_thread_info()->status = 0;
693 689
@@ -699,10 +695,8 @@ void eager_fpu_init(void)
699 return; 695 return;
700 } 696 }
701 697
702 if (boot_func) { 698 if (!init_xstate_buf)
703 boot_func(); 699 setup_init_fpu_buf();
704 boot_func = NULL;
705 }
706} 700}
707 701
708/* 702/*