Received: by 10.223.176.46 with SMTP id f43csp2687818wra; Thu, 25 Jan 2018 13:38:34 -0800 (PST) X-Google-Smtp-Source: AH8x224JwJEdIUmv3WJOcoVQXaIBEoGHsSMLVq0Dx9t5sLK1SICaDeAikxE4CZcBYTHlKMDo0OVO X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr2767318plr.437.1516916314751; Thu, 25 Jan 2018 13:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516916314; cv=none; d=google.com; s=arc-20160816; b=ftZuRk7o0t0AXh2fmkN8XeokRRZHM4hk/MFnkaefNJ40beRGM0Iv69+06Ui1zc0GDM ZDfHR8bX2cqCaK5aS0g2lIyeNJno+OlUXcGBGcEqkqFEFyo6A7Yg5OXum0JLL40a0Ga/ avhs1LRJl9kEtDk0bs9vHfH/flDBc7O1R3YVW4zxFrZBTzSFs+CW9ugpNgVfNt+xMMUt Qq7/HZo8rfIAHyNYp8WNWqq4Hut90JE/fvPvVBvMz2gs3buFGo+tPiE0BHsqTYFINS4k HuQAp1sr6hIcpKCq/v5nl+nT2SFB0YQ/BrsGXdua2QCMdPZDmByeMonyF0n+g6Be5Fh8 3luA== 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=KXec/4qQtGFGGTPTM3kdXea4dXcjee+yZRlbHkW4sTQ=; b=jtNuY4zI4u8+qyzNpnbQ55Sc/Uw+40T3EIjXkXnbolOgnVp25hO8RORC1a4lUKPqUp DoK7lvBKnWJ/F/JSOz1TfPV44tpT62hwmcm9Cmj+aaCYcQEMEJbf5MrA8hsclbrRU8KX eAwAUUAZKzbH+oNRNdPmxq/B7vBbLO1NOZcSV2e2o4/rVyRLB7MwNFh8TQHzi7OWa4KI UfxtJ2NzTloil1aEeS6mPpDDuwKwsdjn9+H1A33ioGVr9CzpCN9dTR7k5/OwtN9uT9iP KR5KkSKLL0651NFzZGS4iLhRMnGzHn+CIZ9Z0oyywk1cqK3bqbmsNG/rTslzVuCAhu44 ik1g== 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 m5si2057340pgp.355.2018.01.25.13.38.19; Thu, 25 Jan 2018 13:38:34 -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 S1751443AbeAYVhq (ORCPT + 99 others); Thu, 25 Jan 2018 16:37:46 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:36152 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181AbeAYVhp (ORCPT ); Thu, 25 Jan 2018 16:37:45 -0500 Received: from p4fea5f09.dip0.t-ipconnect.de ([79.234.95.9] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eepAW-00075A-R5; Thu, 25 Jan 2018 22:34:49 +0100 Date: Thu, 25 Jan 2018 22:37:30 +0100 (CET) From: Thomas Gleixner To: Borislav Petkov cc: David Woodhouse , Tom Lendacky , arjan@linux.intel.com, 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 In-Reply-To: <20180125213048.yd5cloxh2ttggeas@pd.tnic> Message-ID: References: <1516896855-7642-1-git-send-email-dwmw@amazon.co.uk> <1516896855-7642-4-git-send-email-dwmw@amazon.co.uk> <20180125213048.yd5cloxh2ttggeas@pd.tnic> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Jan 2018, Borislav Petkov wrote: > + 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. That wont work as the intel bits are at a different leave and we cant define the same thing twice.... Thanks, tglx