From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932354AbcI3IdD (ORCPT ); Fri, 30 Sep 2016 04:33:03 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36110 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932236AbcI3Ic4 (ORCPT ); Fri, 30 Sep 2016 04:32:56 -0400 Message-ID: <1475224365.17348.1.camel@saggiorato.net> Subject: Re: [RFC PATCH] x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we don't have CPUID From: David Saggiorato To: Andy Lutomirski , x86@kernel.org Cc: Borislav Petkov , Brian Gerst , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dave Hansen , Ingo Molnar Date: Fri, 30 Sep 2016 10:32:45 +0200 In-Reply-To: <8de723afbf0811071185039f9088733188b606c9.1475103911.git.luto@kernel.org> References: <8de723afbf0811071185039f9088733188b606c9.1475103911.git.luto@kernel.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-mS8z5aM6UFREEL7KGj9s" X-Mailer: Evolution 3.18.5.2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-mS8z5aM6UFREEL7KGj9s Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Tested-by: David Saggiorato Le mercredi 28 septembre = 2016 =C3=A0 16:06 -0700, Andy Lutomirski a =C3=A9crit=C2=A0: > Otherwise arch_task_struct_size =3D=3D 0 and we die.=C2=A0=C2=A0While we'= re at it, > set X86_FEATURE_ALWAYS, too. >=20 > Cc: stable@vger.kernel.org > Cc: Dave Hansen > Cc: Ingo Molnar > Fixes: aaeb5c01c5b ("x86/fpu, sched: Introduce > CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT and use it on x86") > Reported-by: david@saggiorato.net > Signed-off-by: Andy Lutomirski > --- >=20 > Totally untested except by the 0-day bot, since I don't have an > affected machine and QEMU can't emulate anything without CPUID. >=20 > =C2=A0arch/x86/kernel/cpu/common.c | 23 +++++++++++------------ > =C2=A01 file changed, 11 insertions(+), 12 deletions(-) >=20 > diff --git a/arch/x86/kernel/cpu/common.c > b/arch/x86/kernel/cpu/common.c > index 809eda03c527..bcc9ccc220c9 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -804,21 +804,20 @@ static void __init early_identify_cpu(struct > cpuinfo_x86 *c) > =C2=A0 identify_cpu_without_cpuid(c); > =C2=A0 > =C2=A0 /* cyrix could have cpuid enabled via c_identify()*/ > - if (!have_cpuid_p()) > - return; > + if (have_cpuid_p()) { > + cpu_detect(c); > + get_cpu_vendor(c); > + get_cpu_cap(c); > =C2=A0 > - cpu_detect(c); > - get_cpu_vendor(c); > - get_cpu_cap(c); > - > - if (this_cpu->c_early_init) > - this_cpu->c_early_init(c); > + if (this_cpu->c_early_init) > + this_cpu->c_early_init(c); > =C2=A0 > - c->cpu_index =3D 0; > - filter_cpuid_features(c, false); > + c->cpu_index =3D 0; > + filter_cpuid_features(c, false); > =C2=A0 > - if (this_cpu->c_bsp_init) > - this_cpu->c_bsp_init(c); > + if (this_cpu->c_bsp_init) > + this_cpu->c_bsp_init(c); > + } > =C2=A0 > =C2=A0 setup_force_cpu_cap(X86_FEATURE_ALWAYS); > =C2=A0 fpu__init_system(c); --=-mS8z5aM6UFREEL7KGj9s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQIcBAABCAAGBQJX7iM0AAoJEIjSTj4GxqnltFcQAJQk7sw/heelM1sHwdGiglL9 Q97nBs6ZrOYjY3YQg44wHuto/do+VT8sqSt3XS6CEU1Znd67iRgsNmMp/1P/tav+ uoyBqAaU54Jmx/BwgKScsqj1O5slsdUChWcyxogO+DwpPrWhNmUWDo0zuroX0v8C YWLwIZWnxMvH73PYsGfL5nP3CzAvNVpCR8dsEWpFEnha1b+zaQn5Sf80YJXlKIZm CCX6SPz47UVHsWzUaSwubUklpk61cdifJlId08WPhU3OZzSU1CyA+2MAfe3B7VTv //qiaaHBMOdef3FkLGwUpPUwNbFor5rAzMPL6XTm+XI5WFcr+IDwwuwvmHYfYJGY uNJivWtq15bAA8e8AQZCDbQoTfyClyucipT7s7OQcgoT3chwjYc9zjWAceHgVP+y KzEemSPskvdiTAf8k2lsAQ10o1n6M/C3VKdD3h2V4AtWANLrIteefPHFCIseGC0e 5fRqDtPRUg84XQCvx8Pd8RQQe6EgNkgg161pVnL0FbGArmnLQcpQdrYzRr1gdplS wTwccdxwjiobDlPPiePS94CTEx8W+XIkB9LsKApejGsLqXRAp+lHeWFPO04j2Wcx ow9KO0GRmPdTbC46LJyaB8IekP3ZQZ5krQesWy+RhZ3Ot6IBglskg0agBJHndB1b OQe95ZiaeWBJF53JBmJL =Tik7 -----END PGP SIGNATURE----- --=-mS8z5aM6UFREEL7KGj9s--