Received: by 10.192.165.148 with SMTP id m20csp392517imm; Wed, 2 May 2018 02:03:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp1b+JLcemX7aFzlvh1IBwokGQ/1q7ywEo78Youd2E+bdfIztQCJe66GoK5ut04i5KAd2s5 X-Received: by 2002:a17:902:7d09:: with SMTP id z9-v6mr19525377pll.4.1525251780416; Wed, 02 May 2018 02:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525251780; cv=none; d=google.com; s=arc-20160816; b=LAd/k8yNqBoicAM2eXwqnzZrogpbPjj8AjawdWypubApsC4hIpqXBlIBbznT1c1jU0 nheTAXmjVxIS1qfRx1iom6Rb+2koPhd2vrO+o8dF6kbGSDOt6rsrlJ4Egna1NcFmCGJ6 X4sUFVzANCkJ40FCRnZ/d+h6Vc1hgplrqvfMAsOvffDtQPdUFD9ANyySImqscQZT5RRz nlObBr+MxSW4M0R9uh6cutBowHlklckpF4fiYk9u2oEyjnhlf7NtwKP6wvEBVky205mf KMAmvEv5cDOB6fJtO3yFc81UUf+MHGVh9v42x7IMMjN9tpRFNmfT1yD5bGTprgpnl46g OikA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=DwrpS/xCvYiAdRc6vqJNxKSVoE3tqJOpoi89hE/nuQU=; b=hGAkgOSLW1fOqNMQ4vdnuqca71L2GtwlFRmPj9ot6a61oAweMW7YnaxGujFHjIaXIM kf+nFn9M1aZoC2Gi75fL0wrEsbsODuSdBgur47YOiGox+FWDagBjMOPbNYNnkm9TSNK0 NVmDeVx0JRO14BZc42BpJkkQYoYoL1l0m30K5vyhEeMougMB67LdZUTx4lVAqY13SV5G lXHqblHRIV111jCERTiZpxkDkTsJcyUagQ2Lf6TlzD43YY7CjshwxGNnA9amhn8aKhSH Fhr9oNCeW8n3xXEHh25ODlULz10qD9yLCTCv4Yku7EWWVCb48XHfna5CXY95kOa/J2CX GvDw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si10709014plf.78.2018.05.02.02.02.45; Wed, 02 May 2018 02:03:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751029AbeEBJCe (ORCPT + 99 others); Wed, 2 May 2018 05:02:34 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:52297 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbeEBJCd (ORCPT ); Wed, 2 May 2018 05:02:33 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDneg-0006QR-Dn; Wed, 02 May 2018 11:02:30 +0200 Date: Wed, 2 May 2018 11:02:30 +0200 (CEST) From: Thomas Gleixner To: =?ISO-8859-15?Q?J=F6rg_Otte?= cc: Linus Torvalds , "Kirill A. Shutemov" , Linux Kernel Mailing List , Borislav Petkov Subject: Re: [v4.17-rcx] Lost IBPB, IBRS_FW support for spectre_v2 mitigation. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-80793740-1525251750=:1668" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-80793740-1525251750=:1668 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 2 May 2018, Jörg 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 = 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 = 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=0x306c3, pf=0x10, revision=0x24 > [ 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=0x306c3, pf=0x10, revision=0x24 > [ 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 = 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=0x306c3, pf=0x10, revision=0x24 > [ 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 differently. 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 = edx; } + if (c->extended_cpuid_level >= 0x80000008) { + cpuid(0x80000008, &eax, &ebx, &ecx, &edx); + c->x86_capability[CPUID_8000_0008_EBX] = ebx; + } + if (c->extended_cpuid_level >= 0x8000000a) c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a); @@ -871,7 +876,6 @@ static void get_cpu_address_sizes(struct c->x86_virt_bits = (eax >> 8) & 0xff; c->x86_phys_bits = eax & 0xff; - c->x86_capability[CPUID_8000_0008_EBX] = ebx; } #ifdef CONFIG_X86_32 else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) --8323329-80793740-1525251750=:1668--