From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbbCWMXW (ORCPT ); Mon, 23 Mar 2015 08:23:22 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41309 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbbCWMXU (ORCPT ); Mon, 23 Mar 2015 08:23:20 -0400 Date: Mon, 23 Mar 2015 05:22:56 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: oleg@redhat.com, dave.hansen@intel.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, quentin.casasnovas@oracle.com, priikone@iki.fi, sbsiddha@gmail.com, hpa@zytor.com, fenghua.yu@intel.com, linux-kernel@vger.kernel.org, luto@amacapital.net, riel@redhat.com, bp@suse.de Reply-To: oleg@redhat.com, dave.hansen@intel.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, quentin.casasnovas@oracle.com, priikone@iki.fi, sbsiddha@gmail.com, hpa@zytor.com, fenghua.yu@intel.com, luto@amacapital.net, riel@redhat.com, linux-kernel@vger.kernel.org, bp@suse.de In-Reply-To: <20150314151334.GC13029@redhat.com> References: <20150314151334.GC13029@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Kill eager_fpu_init_bp() Git-Commit-ID: 7fc253e277ecf1ea57c2d670bdbcda3dffd19453 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7fc253e277ecf1ea57c2d670bdbcda3dffd19453 Gitweb: http://git.kernel.org/tip/7fc253e277ecf1ea57c2d670bdbcda3dffd19453 Author: Oleg Nesterov AuthorDate: Sat, 14 Mar 2015 16:13:34 +0100 Committer: Ingo Molnar CommitDate: Mon, 23 Mar 2015 10:14:00 +0100 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 Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: Linus Torvalds Cc: Pekka Riikonen Cc: Quentin Casasnovas Cc: Rik van Riel Cc: Suresh Siddha Link: http://lkml.kernel.org/r/20150314151334.GC13029@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/xsave.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index ada8df7b..87a815b 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -678,16 +678,12 @@ void xsave_init(void) this_func(); } -static inline void __init eager_fpu_init_bp(void) -{ - if (!init_xstate_buf) - setup_init_fpu_buf(); -} - -void eager_fpu_init(void) +/* + * setup_init_fpu_buf() is __init and it is OK to call it here because + * init_xstate_buf will be unset only once during boot. + */ +void __init_refok eager_fpu_init(void) { - static __refdata void (*boot_func)(void) = eager_fpu_init_bp; - WARN_ON(used_math()); current_thread_info()->status = 0; @@ -699,10 +695,8 @@ void eager_fpu_init(void) return; } - if (boot_func) { - boot_func(); - boot_func = NULL; - } + if (!init_xstate_buf) + setup_init_fpu_buf(); } /*