Received: by 10.192.165.148 with SMTP id m20csp5341735imm; Tue, 1 May 2018 13:15:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpmGEZbZw7cMIXSQpGw1j8y2/GFopSaq94XjdAMkZjQT6Kq3Jwlv1cwEV+17UFvpLLlNxVm X-Received: by 10.98.141.201 with SMTP id p70mr16835154pfk.72.1525205744679; Tue, 01 May 2018 13:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525205744; cv=none; d=google.com; s=arc-20160816; b=NMnqVJCebFzhDnyFU70h3xYqzJDoJPYImoFnyzQT9gR3orWcPU62gS57F3faJHatvM A7U33Aty24/IfbQk4DCOyGOTyUsBeg7pEWnqPLxfSeW3i8PJR3XiqPUN/3xaoUppy5fN uLqE0Czgh81rXl6CbKTgvVBLcf8/q5heqOx3BP41iWjqtcMTxGXsTGAX9AAt7+2+s96r 77fGDadUWc9ODUZRst9aWU1PkhPfd1DyYZtUwWQfiIM/ivsvNThg7p4blTlm52WudNk3 2JrWn/AgwRQjXPNSp2z7NT4Cr67fix+ZOYqQ+ne6HOFj+T+5x0e3Eh0BUQeILVcHo2kV z3sA== 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:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=4qd/L2/d81ZnIf5wul9QOVl7iiq+3tlXOVuxl4/dYPU=; b=k9bw8RL+LrUCLmpQPFNFajxuo62nntD6RZqW/tHAm6jQCAbP3fHOqpgSMXWBmcOUgm yCxsyUjVTuUoS7izIaMiajxVvHOz0QQYJa0qlS8q5nLb9H1KfmnY4rUli4dqVHUBVD72 +I8A53CyPy80iIZ/F2G0YevZQBuPSQhQVubRCJug/6caJHJCfkuJzFEjyJzTYllY4Clr xLQ1YcsNeQR3dBX+3tS//HoQQZvLgaq5X5H55pIgYZW700Wc17Ohs+1FZUy8JYjk6Kuk ShsOY+YkGJR4rvPkVrNqlgZjgFh9qhQsLwWIBt0DPvjWVMEV/6y/FLi03sEbRuhwzWs1 pIyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Y8hW1gj3; 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 b6-v6si10207864plm.153.2018.05.01.13.15.29; Tue, 01 May 2018 13:15:44 -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=@linux-foundation.org header.s=google header.b=Y8hW1gj3; 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 S1751344AbeEAUOt (ORCPT + 99 others); Tue, 1 May 2018 16:14:49 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:44814 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbeEAUOs (ORCPT ); Tue, 1 May 2018 16:14:48 -0400 Received: by mail-io0-f181.google.com with SMTP id d11-v6so14907968iof.11 for ; Tue, 01 May 2018 13:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4qd/L2/d81ZnIf5wul9QOVl7iiq+3tlXOVuxl4/dYPU=; b=Y8hW1gj34KzifNa/2rXlslRemuFsSENqUaRP0QWH5D6I5sySmoNgiG6QwHWjBCAOAD XSLnom53w1xcLwep7tevw4dZznWP+OS4kLIwb2hcC16oEI1oZJ5tkKL0csyUhKv7pR3f OJodzC88NkGb03friQJxe8kmZHfR1HxCDH3p8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4qd/L2/d81ZnIf5wul9QOVl7iiq+3tlXOVuxl4/dYPU=; b=VTzleZlyg2mchWYgVZx8eKloVeMCl3yd/BipZ36N6wtX4JmQhoKFceLs+vOl3TnWkY dh83M/eZyJ3HdwBqmYoifFFyvwyIlQ6maQbPom8OfLhZJ+rgO9AnapZnlUvrVRao2LT5 7BHt1uzzbEYif4LDzhazSewHCVL/8Tbto+3iXOnjeuDriPDEdebJAA0P7Bmn//Pc4qoW FM0yg3ZpEcL2YatxH0x6yUomyIteZyMpkHhhmGX4aVQrCrfPOCfaKqctTZY+AtKXmtV8 R0im1ykWjXgmvyA+exi4p81gm5U7Euoc3p8BPk7jQObSssPGjuG3re9ieC08Abj+9uJN uiSQ== X-Gm-Message-State: ALQs6tD8F1uBE1KCPkDZ0BFuyGNmqjVoe5cUSpwx+ALAImaarlMYB0mi n2H5es2dakeYRG/R82QSnLC+pY4eqxeZ2JstyDs= X-Received: by 2002:a6b:dc12:: with SMTP id s18-v6mr18900253ioc.203.1525205687584; Tue, 01 May 2018 13:14:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Tue, 01 May 2018 20:14:37 +0000 Message-ID: Subject: Re: [v4.17-rcx] Lost IBPB, IBRS_FW support for spectre_v2 mitigation. To: Thomas Gleixner Cc: =?UTF-8?Q?J=C3=B6rg_Otte?= , "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 On Tue, May 1, 2018 at 5:59 AM Thomas Gleixner wrote: > Then I really have no idea how reverting the patch you pointed out would > fix it. So I do think that the original patch is buggy. What I think *may* be going on is: - first we do that get_cpu_cap(c); get_cpu_address_sizes(c); but at that point, CPU levels may be masked, and that 0x80000008 leaf isn't seen - then we do if (this_cpu->c_early_init) this_cpu->c_early_init(c); which calls early_init_intel(), which does that if (msr_clear_bit(MSR_IA32_MISC_ENABLE, MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) > 0) { which now raises the cpuid_level. - then we do get_cpu_cap(c); again, because the cpuid level has been raised, and _now_ it used to ge= t that 0x80000008 leaf information. But with the change, that second call to get_cpu_cap() didn't do anything, because the 0x80000008 leaf handling had been moved away. However, I agree that your patch to just do that CPUID_8000_0008_EBX in get_cpu_cap() should have fixed it, and it's possible that J=C3=B6rg mis-te= sted it. J=C3=B6rg, are you sure you didn't somehow get the wrong microcode? Because another way for those bits to be cleared again is if bad_spectre_microcode() triggers. That should show up in dmesg as "Intel Spectre v2 broken microcode detected" though. Linus