Received: by 10.223.176.46 with SMTP id f43csp1775234wra; Sun, 21 Jan 2018 04:17:26 -0800 (PST) X-Google-Smtp-Source: AH8x225OB4pXnSWdq/eQuuL8MD0pKVK+znXxZRprstGDHYyGwmUAwevntR703aY0CrIEuX3r1Vmg X-Received: by 10.101.82.203 with SMTP id z11mr4521479pgp.164.1516537046321; Sun, 21 Jan 2018 04:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516537046; cv=none; d=google.com; s=arc-20160816; b=R3GQnkX4RaMbBYQ153S8ko3X/lxDAfkojQmSMnJc0Glf0t5Y9N2NfzbWOrLwh41PLC 93PpFcScTJUZyBlnkb3V2d5WrUHqfq8uPI/NxHrG6fkvqG6jTrpefIyCL3aOVS47fm30 /o2PjuEObSqRiBwwfEr8RNcSJLTsWjnnDYmSDUFQTo43S2mNoloJYdanae2NLKj2JsWW VJOlx1pdlgjmdzLPvi9O7jSZrC2WYQQcd01uAaNRMVLslnKcoIiPnfh+qwuwOMprUWSo 2ZP7Gqi1Erc8JXa8BU5CQVcuNOV/6CxPvPk1vP4WdhaI9jDYMWptssjS5n7krMLTLW+z R5RQ== 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=cWpNvj26Sfw7Zj0HGJ4Zfd62/GHhGd9nIG91rM8GdaU=; b=Ud5yj1r5iwIumI8UQRG3dmSfAaAFEXWWkYlkQiW/GYqieG7hMqeLbGyTQ3818dQidi KtNCgLYTsVEVkzZ4a0JKbHYtKbbzJ1kCdFHUPfg9O4t7Q8FVM6QLBsdAVxJ2j91yN69I 4E4swR0jqa8N7VPR6D+4+GTHlzi68RjRWYUMlUSHyWkR5eB9VwXXk6m0grTel1P7XVf8 rafk7GyPihu2+Og8LBAWznlhnPcso/x57IYP97UBZ3O6VM+RIHMZaOFKEAKfl4rI4ISt us3FaZbSJ4gBv1xOCFKYli8BWaLoqdfsyxkvF83h5PYNLDkWEsny0BUGnkBDrfKOsHY8 s/pw== 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 g21si12312747pgn.58.2018.01.21.04.17.12; Sun, 21 Jan 2018 04:17:26 -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 S1751174AbeAUMQu (ORCPT + 99 others); Sun, 21 Jan 2018 07:16:50 -0500 Received: from mail.skyhub.de ([5.9.137.197]:38232 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbeAUMQt (ORCPT ); Sun, 21 Jan 2018 07:16:49 -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 Ql6EhH8S9qko; Sun, 21 Jan 2018 13:16:48 +0100 (CET) Received: from pd.tnic (p200300EC2BEE1B001C757E499366AA02.dip0.t-ipconnect.de [IPv6:2003:ec:2bee:1b00:1c75:7e49:9366:aa02]) (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 D88291EC02C4; Sun, 21 Jan 2018 13:16:47 +0100 (CET) Date: Sun, 21 Jan 2018 13:16:38 +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 Subject: Re: [PATCH 2/4] x86/cpufeatures: Add AMD feature bits for Prediction Command Message-ID: <20180121121638.jpwyk4npxjcgqzar@pd.tnic> References: <1516449813-7654-1-git-send-email-dwmw@amazon.co.uk> <1516449813-7654-3-git-send-email-dwmw@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1516449813-7654-3-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 On Sat, Jan 20, 2018 at 12:03:31PM +0000, David Woodhouse wrote: > AMD doesn't implement the Speculation Control MSR that Intel does, but > the Prediction Control MSR does exist and is advertised by a separate > CPUID bit. Add support for that. > > Signed-off-by: David Woodhouse > --- > arch/x86/include/asm/cpufeatures.h | 1 + > arch/x86/kernel/cpu/scattered.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > index adebdaa..624d978 100644 > --- a/arch/x86/include/asm/cpufeatures.h > +++ b/arch/x86/include/asm/cpufeatures.h > @@ -207,6 +207,7 @@ > #define X86_FEATURE_RETPOLINE_AMD ( 7*32+13) /* AMD Retpoline mitigation for Spectre variant 2 */ > #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ > > +#define X86_FEATURE_AMD_PRED_CMD ( 7*32+17) /* Prediction Command MSR (AMD) */ Right, so this bit I've seen being called differently. Tom, can you clarify pls? Also, public ZN PPR says about it: CPUID_Fn80000007_EDX [Advanced Power Management Information] (ApmInfoEdx) ... 12 ApmPwrReporting: APM power reporting. Read-only. Reset: Fixed,0. so I'm guessing it has been repurposed or so as APM is not used anymore? Leaving in the rest for reference. > #define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */ > #define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* Fill RSB on context switches */ > > diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c > index df11f5d..c76009e 100644 > --- a/arch/x86/kernel/cpu/scattered.c > +++ b/arch/x86/kernel/cpu/scattered.c > @@ -28,6 +28,7 @@ static const struct cpuid_bit cpuid_bits[] = { > { X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 }, > { X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 }, > { X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 }, > + { X86_FEATURE_AMD_PRED_CMD, CPUID_EDX, 12, 0x80000007, 0 }, > { X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 }, > { 0, 0, 0, 0, 0 } > }; > -- > 2.7.4 > -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.