Received: by 10.223.176.46 with SMTP id f43csp1670484wra; Sun, 21 Jan 2018 01:53:36 -0800 (PST) X-Google-Smtp-Source: AH8x225AyfpNNQFgtZI3xg1JkBxndEE9tEkIY86u7Fp0SIhlCwavb3vvdVakYETCaXKFiMTr3UOc X-Received: by 10.99.50.66 with SMTP id y63mr4093438pgy.157.1516528416346; Sun, 21 Jan 2018 01:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516528416; cv=none; d=google.com; s=arc-20160816; b=buqZnsf0GDm/S96uJsuyxDH6tsyDW9J03g6sm58fZESp0HFN1I0sBJgV2Qg7vhXPuH ymTDJMil574NsVCQJ2RriQdTK4ia4j0bgAMYqBFKeLtKGxb3cnirFe5xQdCZRKr7Y5jf 2aG+HVsuaHBbA7i5Yz4gsUy+8nVTbJoN/q9bt/mmRj5+WbRpbf9hfIsT0Lz4drfel/+U 3y2kpxJVRxTcvH5c/DWHLYnpyDuP63zxU93ZCIUNpNIAy3KE72iPRz2XdriRnPOz1H2H bOz2DY5mWjsiCKEAYf9m625Lin09hfNEWKDbKtMunrFF2LQ7kCp/uzTKcJE/PAxs6hHF kExQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=zSjXczCLziDF+GesyIl9wihkLDbbV5Ew1M/RCmmsqig=; b=PgsLOU3dHTteU5vHFigMxSw5w6eYXw/GeaIIR48S+yrJ4xAu8gGm0QxJ13LokfDCcZ rqDHGDyiiZu32Ma1VejgIKTOQVscKKm2STxJ0bVmtuE5FrKi5JSBM4m7mLXNSRFkDLUT IQaaYzUW+iK596XNBxMcFQwpWvULPncPz+FALw9QKUbYdKINm0kPVSYQtMVuMJm2Gjmq D04j5dfjpcxdcP3ah3d/tiaEblczE5B+piSZ5hOux8RHHBZzSYmXO8Ap+Nruq0EGhDjm +cZg+WPSvW0GfWwH+DxCp4bZoSf9sNF0c/ZrCU/9/rw7gL9+F3WJ6juIe1VEV/HDBm7V sqaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=eH675+YQ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s62si12013017pgb.333.2018.01.21.01.53.22; Sun, 21 Jan 2018 01:53:36 -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=@amazon.co.uk header.s=amazon201209 header.b=eH675+YQ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751131AbeAUJta (ORCPT + 99 others); Sun, 21 Jan 2018 04:49:30 -0500 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:52676 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbeAUJt2 (ORCPT ); Sun, 21 Jan 2018 04:49:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt; s=amazon201209; t=1516528168; x=1548064168; h=from:to:subject:date:message-id:in-reply-to:references; bh=zSjXczCLziDF+GesyIl9wihkLDbbV5Ew1M/RCmmsqig=; b=eH675+YQbi/Ruwdn5EUvXSr/O36UzfPPHDL9kDLfymVO6zrHdl9J/YyK 9B0dc3y5MV3EJLC+aTTdk6m1hTM0BnBLUm5748Q1GOt43R+3s7hmYBYTX zbJXUKwhpRCvSa5VI6KFpHyqHxQLap6TtNGL/+BvT6UvN3rwF4iKQiGfO E=; X-IronPort-AV: E=Sophos;i="5.46,390,1511827200"; d="scan'208";a="588471097" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2b-55156cd4.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jan 2018 09:49:26 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2b-55156cd4.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w0L9nLsu117805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Jan 2018 09:49:23 GMT Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (localhost [127.0.0.1]) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id w0L9nL5h010290; Sun, 21 Jan 2018 09:49:21 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0L9nKZr010288; Sun, 21 Jan 2018 09:49:20 GMT From: David Woodhouse To: arjan@linux.intel.com, tglx@linutronix.de, karahmed@amazon.de, x86@kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, bp@alien8.de, peterz@infradead.org, pbonzini@redhat.com, ak@linux.intel.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org Subject: [PATCH v2 2/8] x86/cpufeatures: Add AMD feature bits for Prediction Command Date: Sun, 21 Jan 2018 09:49:03 +0000 Message-Id: <1516528149-9370-3-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516528149-9370-1-git-send-email-dwmw@amazon.co.uk> References: <1516528149-9370-1-git-send-email-dwmw@amazon.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 2efb8d4..8c9e5c0 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) */ #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..4eb90b2 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_EBX, 12, 0x80000008, 0 }, { X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 }, { 0, 0, 0, 0, 0 } }; -- 2.7.4