Received: by 10.192.165.148 with SMTP id m20csp411484imm; Wed, 2 May 2018 02:26:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrI6yNTlc9QROYWf2GUeoomHlIkXhi6pA9hcsdl1iqJf4dxJH4HuHT40ZF06zQog5tvmvEq X-Received: by 10.98.214.5 with SMTP id r5mr18879770pfg.8.1525253184203; Wed, 02 May 2018 02:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525253184; cv=none; d=google.com; s=arc-20160816; b=OU8NpzqswNrUAdWVI8PaaczWRhV+BpAKN4g7NdDcV8jLS08HfdP1The235bSdnkM3w lg8VnsaQs7BcWlSzUQc0omKfGNc1I9xLIZ3zzVyVc5Fwf7mhN/gQS30pz+eMwc/SlFTR 5H+RH56m4aNzMtnwU/GyI2ZlRlcCbtmtiK/nrZfKz40jzDFJ+LyLxqK9/J70qD/+LSfd e2F9szlxuWQrTtMMFGE+AqPa6tPYWD22+UkA6bgvVxlbXirQxDvai1QnWbMC7OEXbFm5 B49/TTA5yjt7tJoj+mw4MPjEfaPYdFHDn1zJ0hRm5gA5oxd3qPmrp35Ms0jk16gmkHU+ gtnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=sft5pm/SQkI3JQibXB5ZOnuu92UqY7FiHAYu9xfvpQ0=; b=VeVeFBs02mb2bZVsuZQkDNfKJgTAzr7PT0tDwQXH1CAWjftFSDryISR871BSCRwfmq rr4JhGa60svPDEyV4tA+7QUmJLmC6yK0dAbfkVgV+Kf8icT+2DgIzxOk13lzR55zUbRR Fj+PG84IjY4epXw71He998VYVbJLQtHB1K7exrpYgQfPTgIL4cG/JFpy6nrLUuhuk3u4 ORV3AVyQY4zMV6m5v8V3Hz6WpwidL3JN+ZbHNbPg9bJlx45YcwSrso/TM3I3tsfKHsDt n4QxUCNcWDqBvz9eOrIKTattTTJOSmaYm1tcLH5xcXagIr+ROof3AQTXRtBQNJ2fcBFN oR3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NekbU2/x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si10761344pfn.254.2018.05.02.02.26.08; Wed, 02 May 2018 02:26:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NekbU2/x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751140AbeEBJZd (ORCPT + 99 others); Wed, 2 May 2018 05:25:33 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:54927 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbeEBJZb (ORCPT ); Wed, 2 May 2018 05:25:31 -0400 Received: by mail-it0-f68.google.com with SMTP id z6-v6so12749454iti.4 for ; Wed, 02 May 2018 02:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sft5pm/SQkI3JQibXB5ZOnuu92UqY7FiHAYu9xfvpQ0=; b=NekbU2/xTCcwO1lbsD6508KC8B88zc/aisGcocXczWNzFSuBN1Y1SyUJqA2pK1SNv2 TJ/L99UbNPKyLL1ahLsX7tAtyMyLayP87FcoReKiMjC6BVQcffsY3VtWgdKiHWZ/GKMN GOukM30o913X0hYTeKiU7LeZLmdLenCkk/eTwAClBWTZ/w7ZyjtjEaG6ez4uxMsnxrzk AgbUmCiC+8aHmMIXKk7DRKzaIBHq1qNUvhnRaB+B/NJlqMtmhROzRA65ENpkd8BdARre FhUKv/UQXmYTy+lBDDILNpFUH0PX0knehI0SfWElBujmifAgxQDCLYt7Y1GAcdpPd1dF m3Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sft5pm/SQkI3JQibXB5ZOnuu92UqY7FiHAYu9xfvpQ0=; b=XhGcz87aHEjYe3jCj11SeTnWkM9eFk50mM+BUc5gTQrC2pMuJ4/3AeUSYP+XaNR82V RvM0VXD+wEYwFAb6324JLuiIFx7PuEbuveZSYpbQFkY+X25AfjouCxs4RXcHz67QnYM0 URnHgESOJzsXBCollXaXBPYvHXZxkT5pg0Zfwnbf+rJt8z5IpsKLR3eAHCtZnffDqlV5 0PaF9wRqSOHJ4/pKt0mit9vpptDIW9+LWhGIyQLf6TPV1kuWfgpujlsIvFuos5tIZ3fr rBvrXAUQjcdMariGYIrTpXTzE6TPudhzlSiiju7wnwxXHXRdI655KrSD5BkQqpicgLCu QmwA== X-Gm-Message-State: ALQs6tCFqMA+69IolxZNubpVgZGyWt/HHFxd9AnkyGnffwSTDJv33unN AXKDzRz/as/x8aWFkKgNnEkG6NuIDxPqLl1qjw== X-Received: by 2002:a24:14cb:: with SMTP id 194-v6mr13803272itg.79.1525253130495; Wed, 02 May 2018 02:25:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:9e86:0:0:0:0:0 with HTTP; Wed, 2 May 2018 02:25:29 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?J=C3=B6rg_Otte?= Date: Wed, 2 May 2018 11:25:29 +0200 Message-ID: Subject: Re: [v4.17-rcx] Lost IBPB, IBRS_FW support for spectre_v2 mitigation. To: Thomas Gleixner Cc: Linus Torvalds , "Kirill A. Shutemov" , Linux Kernel Mailing List , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-02 11:02 GMT+02:00 Thomas Gleixner : > On Wed, 2 May 2018, J=C3=B6rg Otte wrote: >> With revert: >> >> jojo@fichte:~$ dmesg | grep -i -e spec -e micro -e "Linux version" >> >> [ 0.000000] microcode: microcode updated early to revision 0x24, >> date =3D 2018-01-21 >> [ 0.000000] Linux version 4.17.0-rc3-revert-00001-gcb1069f >> (jojo@fichte) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubu >> >> dmesg | grep -i -e spec -e micro -e "Linux version" >> >> [ 0.000000] microcode: microcode updated early to revision 0x24, >> date =3D 2018-01-21 >> [ 0.000000] Linux version 4.17.0-rc3-patch-00001-gdc10603 >> (jojo@fichte) (gcc version 5.4.0 20160609 (Ubuntu >> 5.4.0-6ubuntu1~16.04.9)) #20 SMP Wed May 2 09:08:07 CEST 2018 >> [ 0.028417] Spectre V2 : Mitigation: Full generic retpoline >> [ 0.491803] microcode: sig=3D0x306c3, pf=3D0x10, revision=3D0x24 >> [ 0.491831] microcode: Microcode Update Driver: v2.2.ntu1~16.04.9)) >> #21 SMP Wed May 2 09:14:29 CEST 2018 >> [ 0.028414] Spectre V2 : Mitigation: Full generic retpoline >> [ 0.028415] Spectre V2 : Spectre v2 mitigation: Enabling Indirect >> Branch Prediction Barrier >> [ 0.028415] Spectre V2 : Enabling Restricted Speculation for firmware= calls >> [ 0.500157] microcode: sig=3D0x306c3, pf=3D0x10, revision=3D0x24 >> [ 0.500183] microcode: Microcode Update Driver: v2.2. >> >> >> With patch: >> >> dmesg | grep -i -e spec -e micro -e "Linux version" >> >> [ 0.000000] microcode: microcode updated early to revision 0x24, >> date =3D 2018-01-21 >> [ 0.000000] Linux version 4.17.0-rc3-patch-00001-gdc10603 >> (jojo@fichte) (gcc version 5.4.0 20160609 (Ubuntu >> 5.4.0-6ubuntu1~16.04.9)) #20 SMP Wed May 2 09:08:07 CEST 2018 >> [ 0.028417] Spectre V2 : Mitigation: Full generic retpoline >> [ 0.491803] microcode: sig=3D0x306c3, pf=3D0x10, revision=3D0x24 >> [ 0.491831] microcode: Microcode Update Driver: v2.2. > > Ok, I think I know what's going wrong in that steaming pile of horrors of > CPUID detection. I need to analyze it down to the roots, but if you have > cycles, can you please test the patch below? > > It's a hack and even if it fixes the problem I'm going to do it different= ly. > > Thanks, > > tglx > > 8<------------------- > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -848,6 +848,11 @@ void get_cpu_cap(struct cpuinfo_x86 *c) > c->x86_power =3D edx; > } > > + if (c->extended_cpuid_level >=3D 0x80000008) { > + cpuid(0x80000008, &eax, &ebx, &ecx, &edx); > + c->x86_capability[CPUID_8000_0008_EBX] =3D ebx; > + } > + > if (c->extended_cpuid_level >=3D 0x8000000a) > c->x86_capability[CPUID_8000_000A_EDX] =3D cpuid_edx(0x80= 00000a); > > @@ -871,7 +876,6 @@ static void get_cpu_address_sizes(struct > > c->x86_virt_bits =3D (eax >> 8) & 0xff; > c->x86_phys_bits =3D eax & 0xff; > - c->x86_capability[CPUID_8000_0008_EBX] =3D ebx; > } > #ifdef CONFIG_X86_32 > else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PS= E36)) > OK, that patch works for me! Thanks, J=C3=B6rg