Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbcLFSAT (ORCPT ); Tue, 6 Dec 2016 13:00:19 -0500 Received: from mail-ua0-f175.google.com ([209.85.217.175]:36490 "EHLO mail-ua0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbcLFSAR (ORCPT ); Tue, 6 Dec 2016 13:00:17 -0500 MIME-Version: 1.0 In-Reply-To: <20161206092424.crarepjm2ntkfpd4@pd.tnic> References: <21c7c86831db499b725f70d6603327f4ebcf09cf.1480985979.git.luto@kernel.org> <20161206092424.crarepjm2ntkfpd4@pd.tnic> From: Andy Lutomirski Date: Tue, 6 Dec 2016 09:59:56 -0800 Message-ID: Subject: Re: [RFC PATCH 4/6] x86/fpu: Fix "x86/fpu: Legacy x87 FPU detected" message To: Borislav Petkov Cc: Andy Lutomirski , X86 ML , One Thousand Gnomes , "linux-kernel@vger.kernel.org" , Brian Gerst , Matthew Whitehead Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1815 Lines: 58 On Tue, Dec 6, 2016 at 1:24 AM, Borislav Petkov wrote: > On Mon, Dec 05, 2016 at 05:01:13PM -0800, Andy Lutomirski wrote: >> That message isn't at all clear -- what does "Legacy x87" even >> mean? >> >> Clarify it. If there's no FPU, say "x86/fpu: No FPU detected". If >> there's an FPU that doesn't have XSAVE, say "x86/fpu: Pre-XSAVE x87 >> FPU detected". >> >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/kernel/fpu/xstate.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c >> index 1d7770447b3e..2d592b1c75e4 100644 >> --- a/arch/x86/kernel/fpu/xstate.c >> +++ b/arch/x86/kernel/fpu/xstate.c >> @@ -705,8 +705,13 @@ void __init fpu__init_system_xstate(void) >> WARN_ON_FPU(!on_boot_cpu); >> on_boot_cpu = 0; >> >> + if (!boot_cpu_has(X86_FEATURE_FPU)) { >> + pr_info("x86/fpu: No FPU detected.\n"); >> + return; >> + } >> + >> if (!boot_cpu_has(X86_FEATURE_XSAVE)) { >> - pr_info("x86/fpu: Legacy x87 FPU detected.\n"); >> + pr_info("x86/fpu: Pre-XSAVE x87 FPU detected.\n"); > > Well, there's also FXSAVE and FSAVE. The legacy thing kinda made sense > to me here. > > Maybe say something like this: > > pr_info("x86/fpu: FPU detected: FSAVE|FXSAVE|XSAVE support\n", ... > > and use X86_FEATURE_XSAVE and X86_FEATURE_FXSR to print the respective > *SAVE string...? FSAVE we issue by default. I did something like this for FSAVE vs FXSAVE. XSAVE has its own pile of printouts and I don't feel like I need to add another. > > Hmm. > > -- > Regards/Gruss, > Boris. > > Good mailing practices for 400: avoid top-posting and trim the reply. -- Andy Lutomirski AMA Capital Management, LLC