Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751359AbcCKJsb (ORCPT ); Fri, 11 Mar 2016 04:48:31 -0500 Received: from mail.skyhub.de ([78.46.96.112]:38100 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbcCKJsW (ORCPT ); Fri, 11 Mar 2016 04:48:22 -0500 Date: Fri, 11 Mar 2016 10:48:02 +0100 From: Borislav Petkov To: Ingo Molnar , "Bryan O'Donoghue" Cc: Andy Lutomirski , Andy Shevchenko , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Fenghua Yu , Linus Torvalds , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Dave Hansen , Oleg Nesterov , "Yu, Yu-cheng" Subject: Re: Got FPU related warning on Intel Quark during boot Message-ID: <20160311094802.GA4312@pd.tnic> References: <20160310111935.GB13102@gmail.com> <20160310125610.GA26708@pd.tnic> <20160310145940.GB26708@pd.tnic> <20160311090840.GA8486@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160311090840.GA8486@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1289 Lines: 48 On Fri, Mar 11, 2016 at 10:08:40AM +0100, Ingo Molnar wrote: > So yes, this needs to be fixed too. Yes indeed. So the diff below seems to work with Bryan's simple test case. Bryan, can you confirm on your box pls? --- diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index dea8e76d60c6..8e37cc8a539a 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -474,8 +474,10 @@ static inline void copy_init_fpstate_to_fpregs(void) { if (use_xsave()) copy_kernel_to_xregs(&init_fpstate.xsave, -1); - else + else if (static_cpu_has(X86_FEATURE_FXSR)) copy_kernel_to_fxregs(&init_fpstate.fxsave); + else + copy_kernel_to_fregs(&init_fpstate.fsave); } /* diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index e12cc0ad368e..c835f61d5feb 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -134,7 +134,7 @@ static void __init 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.) */ - fpstate_init_fxstate(&init_fpstate.fxsave); + fpstate_init(&init_fpstate); fpu__init_system_mxcsr(); } --- Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.