Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030630AbbEERwr (ORCPT ); Tue, 5 May 2015 13:52:47 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:34255 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030568AbbEERwo (ORCPT ); Tue, 5 May 2015 13:52:44 -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 101/208] x86/fpu: Move legacy check to fpu__init_system_xstate() Date: Tue, 5 May 2015 19:49:53 +0200 Message-Id: <1430848300-27877-23-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: 1671 Lines: 56 Now that legacy code can execute fpu__init_cpu_xstate() in xsave_init(), we can move the once per boot legacy check into fpu__init_system_xstate(), where it belongs. 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/xsave.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c index 0610f431f77f..fd656cbdd315 100644 --- a/arch/x86/kernel/fpu/xsave.c +++ b/arch/x86/kernel/fpu/xsave.c @@ -653,6 +653,11 @@ void fpu__init_system_xstate(void) { unsigned int eax, ebx, ecx, edx; + if (!cpu_has_xsave) { + pr_info("x86/fpu: Legacy x87 FPU detected.\n"); + return; + } + if (boot_cpu_data.cpuid_level < XSTATE_CPUID) { WARN(1, "x86/fpu: XSTATE_CPUID missing!\n"); return; @@ -711,14 +716,6 @@ void xsave_init(void) { static char on_boot_cpu = 1; - if (!cpu_has_xsave) { - if (on_boot_cpu) { - on_boot_cpu = 0; - pr_info("x86/fpu: Legacy x87 FPU detected.\n"); - } - return; - } - if (on_boot_cpu) { on_boot_cpu = 0; 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/