Received: by 10.223.176.46 with SMTP id f43csp749972wra; Sat, 20 Jan 2018 04:09:02 -0800 (PST) X-Google-Smtp-Source: AH8x226q5mjauhMZ1j9amz5uLIBavKTaELpUEUZ7MlBg6Y8EPglZUcdIsX69jczsRplKeNzjYYxI X-Received: by 10.101.96.44 with SMTP id p12mr1754930pgu.390.1516450142248; Sat, 20 Jan 2018 04:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516450142; cv=none; d=google.com; s=arc-20160816; b=AJ9KObSG08POufNBRYopR425oysi8gMlH6Kl238ulP1Dj9HdwGMSdfybB9I/b/U+Fu bI/jI8VS4npq8M8zoh9TAUIBWgxb60wG/CrcKrP8bF64ZMPoy4h90A5VDVyvHqN49mnt 9skNSSjS17UdmuB+WgYSaOx7Vz/Opw02/ADpkNH/8ZIBU7JBLECW3uApBu8Ng2nJzpnf uT7lM34RNnU5HnKAM5ZEY7DG7JRFSppf88ip2IuEICKFHHwNC6Km/JrOl5wOUHMRD9VI 3IfpV8xyZBiBlZ8akhpqCKybg1ZqzBr1jBqGZLzdOfKKjw/JSzaQg5De7MRB4AKjgMIS oM+Q== 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=CdYCXE1QF47JHZJuEjUSXWDmGKL52VQvNlTffXpDST8=; b=VrxKZp8cH1lQZD8VLZooo+95+P+aLj4z9lNCiMopiJnyyC5k5YNm0Xquc5GtN2SR5Q IxwJL46BjyajulfWGYx7JOsuFC4R5HzyHbaI0vASxNILDhTpLmLRFTpApkaw8OVgGUJ5 ytLn55CzBPzPDazBMhraOonhuTLr/FjK4t7EuetCQR0VNZuNPbh5WsvEmtv+nb8mU/mG U3a7bwQjPdSvPpMb712U4IYJ+RImOuZCMMTEQPa0ENXw/s7J4PEygki5G2/ex0LS80Gb AbejH7xCF1vhmn8gb7qg8Jufe6rmOdqZxfUag8iFj7nR8l3v//9oVyuFmrr9+uJ/ACtS b/5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=du4bekQE; 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 c9si9875812pgq.542.2018.01.20.04.08.48; Sat, 20 Jan 2018 04:09:02 -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=du4bekQE; 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 S1754831AbeATMEE (ORCPT + 99 others); Sat, 20 Jan 2018 07:04:04 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:24094 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbeATMEA (ORCPT ); Sat, 20 Jan 2018 07:04:00 -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=1516449840; x=1547985840; h=from:to:subject:date:message-id:in-reply-to:references; bh=CdYCXE1QF47JHZJuEjUSXWDmGKL52VQvNlTffXpDST8=; b=du4bekQExbuelbMAeW8JwrsZQ2QmCWqIztoQogeA+kKS+5vAB2tAosk+ WqMT+D0he+gNgL+txT2FjsWxDu7hi+E0CnjXYcX71PU8oc9ANGzz5nM1A FLeWe3riWmGGwqoull45eGbZAhNup0dlemnZHmgkADyoP1J67NjID3wUK U=; X-IronPort-AV: E=Sophos;i="5.46,386,1511827200"; d="scan'208";a="704460039" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-cd289015.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jan 2018 12:03:51 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (pdx2-ws-svc-lb17-vlan2.amazon.com [10.247.140.66]) by email-inbound-relay-2c-cd289015.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w0KC3i8i062033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Jan 2018 12:03:46 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 w0KC3hMO007836; Sat, 20 Jan 2018 12:03:43 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0KC3hKh007834; Sat, 20 Jan 2018 12:03:43 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 2/4] x86/cpufeatures: Add AMD feature bits for Prediction Command Date: Sat, 20 Jan 2018 12:03:31 +0000 Message-Id: <1516449813-7654-3-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516449813-7654-1-git-send-email-dwmw@amazon.co.uk> References: <1516449813-7654-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 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) */ #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