Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8118564imu; Tue, 4 Dec 2018 03:19:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/lrImPzS7L3mLZ9fdZzILLjhIBmiQ500E1/MrB7YR4oaPcmz4P53yHJW52m1Xju+vhnTh X-Received: by 2002:a63:ed42:: with SMTP id m2mr15236462pgk.147.1543922353375; Tue, 04 Dec 2018 03:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543922353; cv=none; d=google.com; s=arc-20160816; b=AnX1Yeamkt4hBARloCy1g3vKbBiE/NxTkpNBICjHTkdb+zC4gvqKkfGxI1P6TcIkaI tGSsmtzscQSo7E4rFML1FMRtgpb1kMmBTf4GvmUJvXkmTjcESAG9/qrZoZCOagqoqCpz nPHb7v5TOvSkpmlvztKtGu5Lv+u2TxYV8zJ7Yd7ZuqAU7fAZYJi7pvVg6CSa3njntyvK FFRIe3qrXnKDzy5JqcsOXkXEfU99akpiwh4HktrXh8nmPUeRM/cm+byWTyB2qv0baTPv Bsf9gHZC4zy8c+ITEvXW+LXUZ8J43/H2iq0IOz34MdIrF4jE26Y1pOayF6Ng4f7U2KbV IL3Q== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AkzYwDYLjdxQ3H7bGC4tawV6LEPcEeeW081ccOWeXdI=; b=x77pn2KRtcIsSWIqm9mXp/7ODRWfAdqFQz2nrAUJm/gBBy8wZvCzEf6nF157p0Ra1L Dwt8r/dWwtVB+YL5fIlpO8/nZntqYghuT2vrMqHKNXGnNjNMfrLPhIQZqc5RLD0SNiT1 0MoYncGSFoERZMykVYXfUL+WyHEZbHc6C4P5tFJWUlyN/Aht4Xs1De3AL8Ama69DAldq 0uWCXI64xBJA59xgLufixsIAElJP1YeLFkwOqSV9AXFrrtkwSurJwIVb6cVw7sYGGnMs g33Bdgm0my0NpIva7n0QQ855SAcevclNY1ijQPTACwO+sCDiZQrSG0ffUQaYMZB1WbcG nk5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sngmoEFu; 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 f127si9887377pfc.69.2018.12.04.03.18.57; Tue, 04 Dec 2018 03:19:13 -0800 (PST) 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=@kernel.org header.s=default header.b=sngmoEFu; 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 S1728146AbeLDLF0 (ORCPT + 99 others); Tue, 4 Dec 2018 06:05:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:53154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbeLDLFY (ORCPT ); Tue, 4 Dec 2018 06:05:24 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B502E214DE; Tue, 4 Dec 2018 11:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921523; bh=ovSiYiymwV3SIO1P/PFsz7QWYYVB+j6Cbk8JUUy1okY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sngmoEFuKjvhtxZxHMSCggIHdsfrZyYZpY5oPWaVJSlgEn2hP9snz6OQgFC5m+roM iqwTnjE0Zwr3JCchqX3csfWo36MGFl1iQRxohqmSe2L37/myng6gfFNHcXLDpuHzeG Gqu/dw/vaMthaPgZlJHgwkiGRv0Ao53NnD4XoV+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konrad Rzeszutek Wilk , Thomas Gleixner , Tom Lendacky , Janakarajan Natarajan , kvm@vger.kernel.org, andrew.cooper3@citrix.com, Andy Lutomirski , "H. Peter Anvin" , Borislav Petkov , David Woodhouse Subject: [PATCH 4.14 069/146] x86/bugs: Add AMDs variant of SSB_NO Date: Tue, 4 Dec 2018 11:49:15 +0100 Message-Id: <20181204103729.615003937@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103726.750894136@linuxfoundation.org> References: <20181204103726.750894136@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Konrad Rzeszutek Wilk konrad.wilk@oracle.com commit 24809860012e0130fbafe536709e08a22b3e959e upstream 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 Signed-off-by: Greg Kroah-Hartman --- 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(-) --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -285,6 +285,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 */ --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -958,7 +958,8 @@ static void __init cpu_set_bug_bits(stru 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_speculation)) --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -367,7 +367,7 @@ static inline int __do_cpuid_ent(struct /* 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 =