From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031035AbbEERx0 (ORCPT ); Tue, 5 May 2015 13:53:26 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:37798 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758622AbbEERxV (ORCPT ); Tue, 5 May 2015 13:53:21 -0400 From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Borislav Petkov , Dave Hansen , Fenghua Yu , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner Subject: [PATCH 123/208] x86/fpu: Move fpu__init_system_early_generic() out of fpu__detect() Date: Tue, 5 May 2015 19:50:15 +0200 Message-Id: <1430848300-27877-45-git-send-email-mingo@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430848300-27877-1-git-send-email-mingo@kernel.org> References: <1430848300-27877-1-git-send-email-mingo@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the fpu__init_system_early_generic() call into fpu__init_system(), which hosts all the system init calls. Expose fpu__init_system() to other modules - this will be our main and only system init function. Reviewed-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/include/asm/fpu/internal.h | 1 + arch/x86/kernel/fpu/init.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 4617eeb57004..5a1fa5bc2c27 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -41,6 +41,7 @@ extern void eager_fpu_init(void); extern void fpu__init_system_xstate(void); extern void fpu__init_cpu_xstate(void); +extern void fpu__init_system(struct cpuinfo_x86 *c); DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx); diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 63cd1703d25c..1155a98d8c1e 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -5,7 +5,10 @@ #include /* - * The earliest FPU detection code: + * The earliest FPU detection code. + * + * Set the X86_FEATURE_FPU CPU-capability bit based on + * trying to execute an actual sequence of FPU instructions: */ static void fpu__init_system_early_generic(struct cpuinfo_x86 *c) { @@ -200,8 +203,10 @@ static void fpu__init_system_ctx_switch(void) * Called on the boot CPU once per system bootup, to set up the initial FPU state that * is later cloned into all processes. */ -void fpu__init_system(void) +void fpu__init_system(struct cpuinfo_x86 *c) { + fpu__init_system_early_generic(c); + /* The FPU has to be operational for some of the later FPU init activities: */ fpu__init_cpu(); @@ -227,13 +232,8 @@ static int __init no_387(char *s) __setup("no387", no_387); -/* - * Set the X86_FEATURE_FPU CPU-capability bit based on - * trying to execute an actual sequence of FPU instructions: - */ void fpu__detect(struct cpuinfo_x86 *c) { - fpu__init_system_early_generic(c); - fpu__init_system(); + fpu__init_system(c); /* The final cr0 value is set later, in fpu_init() */ } -- 2.1.0