Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp734095imm; Wed, 6 Jun 2018 05:17:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLKyRS3jIPwUObpGXhxS2pWcHXwl3fSY7/J0tv70s4mox4hoHiWGTutBnt6t+ai4WaPf2iu X-Received: by 2002:a62:86c3:: with SMTP id x186-v6mr2254631pfd.4.1528287450604; Wed, 06 Jun 2018 05:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528287450; cv=none; d=google.com; s=arc-20160816; b=PO09QmQALh98/ZniN/i+oTr5Kt8Q2WxM35pMURIaeRZDwiLA1XTmoUPzBgujKo19SK G7pyLfU35Qhfbp1Yqfz3rkj2LMVgSJAaiuIenau5QtXkGylQjksS+Ep6MHXpcUXT1amP Qcpk6bNcE0CO9e1qzqFqGrebInbKY7bbrTV26irg57Hp8A/74abAHxtqgK5sV3oQhSdD 6OD0HCe3zW2SX1F6v4gCYC+NaCALbu1SSEDG3CFV4FYizIUeU/tPZVpVBGoBnNCTt1Ry F1v3tIxnWkC7KxMcwZl89ejZ2m8nQZVycmCGcfWXV1r2yB+WAmDHN2g/d5NFJBKPPItV yjQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=q5Ouw/iNA68S1gkLEdWlzw/cZ9NAJNG2YqHmaUBowdA=; b=ULtoKNLEIVy6btMTSGYBfR0wFEJBonFIK3lWkY7KiKGR7VZAAsDJsit3B4wGiy0sSF E2LH3LJipMNEWvMzAvr4nYkKiof3LWkeujngFZlxjoV5BDYFtD6nq1C5gZ/0xmCubtLV LC6aEWyocmQSM989Uxb7x7x7gGnZtfQjJNl0AWSoLgQ3OoJwQmCTnZfxzXlOXFcJGDyE /sLfg97C2wOusLJB5GuAgR2ZvGPNlTFOisZIEfLwXDHedvSCdIvTvqVhF2FZoSpVMEbI wlheW9d/78PgKm+PIGKLlGQi9Dbi/ScuWAYhBb8boyBV4y/RyubUAbuLriZOXqx3Redx tVjA== 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 w11-v6si14282474pgp.140.2018.06.06.05.17.16; Wed, 06 Jun 2018 05:17:30 -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 S1752114AbeFFMQD (ORCPT + 99 others); Wed, 6 Jun 2018 08:16:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:39269 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbeFFMQC (ORCPT ); Wed, 6 Jun 2018 08:16:02 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w56CFn011774191 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jun 2018 05:15:49 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w56CFlHC1774188; Wed, 6 Jun 2018 05:15:47 -0700 Date: Wed, 6 Jun 2018 05:15:47 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Konrad Rzeszutek Wilk Message-ID: Cc: konrad.wilk@oracle.com, dwmw@amazon.co.uk, thomas.lendacky@amd.com, bp@suse.de, Janakarajan.Natarajan@amd.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, luto@kernel.org Reply-To: hpa@zytor.com, tglx@linutronix.de, Janakarajan.Natarajan@amd.com, mingo@kernel.org, luto@kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, konrad.wilk@oracle.com, bp@suse.de, thomas.lendacky@amd.com In-Reply-To: <20180601145921.9500-2-konrad.wilk@oracle.com> References: <20180601145921.9500-2-konrad.wilk@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/bugs: Add AMD's variant of SSB_NO Git-Commit-ID: 24809860012e0130fbafe536709e08a22b3e959e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 24809860012e0130fbafe536709e08a22b3e959e Gitweb: https://git.kernel.org/tip/24809860012e0130fbafe536709e08a22b3e959e Author: Konrad Rzeszutek Wilk AuthorDate: Fri, 1 Jun 2018 10:59:19 -0400 Committer: Thomas Gleixner CommitDate: Wed, 6 Jun 2018 14:13:16 +0200 x86/bugs: Add AMD's variant of SSB_NO The AMD document outlining the SSBD handling 124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf mentions that the CPUID 8000_0008.EBX[26] will mean that the speculative store bypass disable is no longer needed. A copy of this document is available at: https://bugzilla.kernel.org/show_bug.cgi?id=199889 Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner Cc: Tom Lendacky Cc: Janakarajan Natarajan Cc: kvm@vger.kernel.org Cc: andrew.cooper3@citrix.com Cc: Andy Lutomirski Cc: "H. Peter Anvin" Cc: Borislav Petkov Cc: David Woodhouse Link: https://lkml.kernel.org/r/20180601145921.9500-2-konrad.wilk@oracle.com --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/common.c | 3 ++- arch/x86/kvm/cpuid.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index fb00a2fca990..b6d7ce32927a 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -283,6 +283,7 @@ #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ +#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 95c8e507580d..8e3f062f462d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -992,7 +992,8 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); if (!x86_match_cpu(cpu_no_spec_store_bypass) && - !(ia32_cap & ARCH_CAP_SSB_NO)) + !(ia32_cap & ARCH_CAP_SSB_NO) && + !cpu_has(c, X86_FEATURE_AMD_SSB_NO)) setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS); if (x86_match_cpu(cpu_no_meltdown)) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 92bf2f2e7cdd..132f8a58692e 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -379,7 +379,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, /* cpuid 0x80000008.ebx */ const u32 kvm_cpuid_8000_0008_ebx_x86_features = - F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD); + F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD) | F(AMD_SSB_NO); /* cpuid 0xC0000001.edx */ const u32 kvm_cpuid_C000_0001_edx_x86_features =