Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757818AbbEERxU (ORCPT ); Tue, 5 May 2015 13:53:20 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:33802 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030746AbbEERxM (ORCPT ); Tue, 5 May 2015 13:53:12 -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 118/208] x86/fpu: Factor out fpu__init_system_generic() Date: Tue, 5 May 2015 19:50:10 +0200 Message-Id: <1430848300-27877-40-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 Content-Length: 2514 Lines: 81 Factor out the generic bits from fpu__init_system(). Rename mxcsr_feature_mask_init() to fpu__init_system_mxcsr() to bring it in line with the rest of the nomenclature. 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/kernel/fpu/init.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 37e8b139dc31..c3f3a89cbbf6 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -72,7 +72,7 @@ unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; unsigned int xstate_size; EXPORT_SYMBOL_GPL(xstate_size); -static void mxcsr_feature_mask_init(void) +static void fpu__init_system_mxcsr(void) { unsigned int mask = 0; @@ -94,6 +94,20 @@ static void mxcsr_feature_mask_init(void) mxcsr_feature_mask &= mask; } +/* + * Once per bootup FPU initialization sequences that will run on most x86 CPUs: + */ +static void fpu__init_system_generic(void) +{ + /* + * Set up the legacy init FPU context. (xstate init might overwrite this + * with a more modern format, if the CPU supports it.) + */ + fx_finit(&init_xstate_ctx.i387); + + fpu__init_system_mxcsr(); +} + static void fpstate_xstate_init_size(void) { static bool on_boot_cpu = 1; @@ -230,18 +244,11 @@ void fpu__init_system(void) /* * But don't leave CR0::TS set yet, as some of the FPU setup methods depend * on being able to execute FPU instructions that will fault on a set TS, - * such as the FXSAVE in mxcsr_feature_mask_init(). + * such as the FXSAVE in fpu__init_system_mxcsr(). */ clts(); - /* - * Set up the legacy init FPU context. (xstate init might overwrite this - * with a more modern format, if the CPU supports it.) - */ - fx_finit(&init_xstate_ctx.i387); - - mxcsr_feature_mask_init(); - + fpu__init_system_generic(); fpstate_xstate_init_size(); fpu__init_system_xstate(); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/