Received: by 10.223.176.46 with SMTP id f43csp2681707wra; Thu, 25 Jan 2018 13:32:01 -0800 (PST) X-Google-Smtp-Source: AH8x227Lzb7aBU+qmxLfpPMm+hZk+6jDNqQo+CrXOP5EfOR5+bs0g2Z4plalVQTeRr8Nh7hOQwag X-Received: by 10.101.71.202 with SMTP id f10mr14473053pgs.208.1516915920916; Thu, 25 Jan 2018 13:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516915920; cv=none; d=google.com; s=arc-20160816; b=kGmy7xvHLqQHYY37gFKRW4UbYwMvgqk4Me6+X9azOk/CfvQ8+PMxe7KkNrkL4RbjGq sfVpDl4VsSumi9dFDAMM9qx8reAXRc6ZxwXV80kMxtdDSaxyb+nwkFy2+jpM8gO9AGDs +lI2FicJiPEkMhbO6TPqx4UCHgiNlw9QRkBZnVHL2TxtaLkF2KI4N2jttVfQAaTDugZh 9fHsDtVaiPSXRFxjCJfEsNd1VdRAWGM07IV2KH3OMD+ar3XxNqOor1gUa/X4vkmn4ZxJ ELpxkbWQX553JPu8KeCHXsnB2ThMMp5llzHVFARjR1JyNurcHoSUsRWYPXfPrx2Stu7b 5iig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Kli7bsKqs+eaBYyWTfWH9d84SaYxv5pRWLRnBCnNC4Q=; b=RT7s+OwoC36mDzc5hjfPZCQ5/0Rf/CIT5z4xUePHx9HIiR0vJmGSS67vlwyKXCyTqB Y1/48fZhIeQGrbIslUH1FcCcRnPWM/ZjAPpVvaT0dIncvEVV3QFjharIGC3kZEuxTWNr wCE3vUkIviBne/FE974AORMMe04pQMPuUCnQk8jMuYO2GxhxHQeWv6Sl6ja0LQTrRI1F T0ZtVmZ1e+Tbv8Y8EZOF5mk4+4cNGFz+sbUPVrRbOSpjP6FXk7/rRdemcuWRZ/JhcXKt FpzOnNQvI/rmZFjNhqzbjFEhNQunEXr3r/waBTSwmTQ8b6p9LC/3AUJrN9Crk9otivyb v4vg== 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 x3-v6si2612613plv.589.2018.01.25.13.31.46; Thu, 25 Jan 2018 13:32:00 -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; 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 S1751434AbeAYVbB (ORCPT + 99 others); Thu, 25 Jan 2018 16:31:01 -0500 Received: from mail.skyhub.de ([5.9.137.197]:57370 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbeAYVbA (ORCPT ); Thu, 25 Jan 2018 16:31:00 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WqUSDlfT105v; Thu, 25 Jan 2018 22:30:58 +0100 (CET) Received: from pd.tnic (p200300EC2BD0EE0024194793E6CFFC7A.dip0.t-ipconnect.de [IPv6:2003:ec:2bd0:ee00:2419:4793:e6cf:fc7a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 90B981EC0101; Thu, 25 Jan 2018 22:30:58 +0100 (CET) Date: Thu, 25 Jan 2018 22:30:48 +0100 From: Borislav Petkov To: David Woodhouse , Tom Lendacky Cc: arjan@linux.intel.com, tglx@linutronix.de, karahmed@amazon.de, x86@kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, peterz@infradead.org, pbonzini@redhat.com, ak@linux.intel.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org, dave.hansen@intel.com, gnomes@lxorguk.ukuu.org.uk, ashok.raj@intel.com, mingo@kernel.org Subject: Re: [PATCH v5 3/7] x86/cpufeatures: Add AMD feature bits for Speculation Control Message-ID: <20180125213048.yd5cloxh2ttggeas@pd.tnic> References: <1516896855-7642-1-git-send-email-dwmw@amazon.co.uk> <1516896855-7642-4-git-send-email-dwmw@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1516896855-7642-4-git-send-email-dwmw@amazon.co.uk> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Tom. On Thu, Jan 25, 2018 at 04:14:11PM +0000, David Woodhouse wrote: > AMD exposes the PRED_CMD/SPEC_CTRL MSRs slightly differently to Intel. > See http://lkml.kernel.org/r/2b3e25cc-286d-8bd0-aeaf-9ac4aae39de8@amd.com > > Signed-off-by: David Woodhouse > Reviewed-by: Greg Kroah-Hartman > --- > arch/x86/include/asm/cpufeatures.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > index 0a51070..ae3212f 100644 > --- a/arch/x86/include/asm/cpufeatures.h > +++ b/arch/x86/include/asm/cpufeatures.h > @@ -269,6 +269,9 @@ > #define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */ > #define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */ > #define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */ > +#define X86_FEATURE_AMD_PRED_CMD (13*32+12) /* Prediction Command MSR (AMD) */ > +#define X86_FEATURE_AMD_SPEC_CTRL (13*32+14) /* Speculation Control MSR only (AMD) */ > +#define X86_FEATURE_AMD_STIBP (13*32+15) /* Single Thread Indirect Branch Predictors (AMD) */ So this leaf is AMD-specific so you can drop the AMD strings above. Also, let's simplify this as those flags appear in /proc/cpuinfo: #define X86_FEATURE_IBPB (13*32+12) /* Indirect Branch Prediction Barrier: Prediction Command MSR */ #define X86_FEATURE_IBRS (13*32+14) /* Speculation Control MSR only */ #define X86_FEATURE_STIBP (13*32+15) /* Single Thread Indirect Branch Predictors */ so that we have "ibpb", "ibrs" and "stibp" respectively. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.