Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030726AbbEERxH (ORCPT ); Tue, 5 May 2015 13:53:07 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:37129 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030640AbbEERwv (ORCPT ); Tue, 5 May 2015 13:52:51 -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 105/208] x86/fpu: Set up the legacy FPU init image from fpu__init_system() Date: Tue, 5 May 2015 19:49:57 +0200 Message-Id: <1430848300-27877-27-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: 2032 Lines: 61 The legacy FPU init image is used on older CPUs who don't run xstate init. But the init code is called within setup_init_fpu_buf(), an xstate method. Move this legacy init out of the xstate code and put it into fpu/init.c. 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 | 6 ++++++ arch/x86/kernel/fpu/xsave.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index c1b2d1cfe745..30d2d5d03cb0 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -158,6 +158,12 @@ void fpu__init_system(void) /* The FPU has to be operational for some of the later FPU init activities: */ fpu__init_cpu(); + /* + * 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_xstate(); eager_fpu_init(); diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c index fa9b954eb23a..6be0a98238f6 100644 --- a/arch/x86/kernel/fpu/xsave.c +++ b/arch/x86/kernel/fpu/xsave.c @@ -576,12 +576,6 @@ static void setup_init_fpu_buf(void) return; on_boot_cpu = 0; - /* - * Setup init_xstate_ctx to represent the init state of - * all the features managed by the xsave - */ - fx_finit(&init_xstate_ctx.i387); - if (!cpu_has_xsave) return; -- 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/