Received: by 10.223.176.46 with SMTP id f43csp1669916wra; Sun, 21 Jan 2018 01:52:43 -0800 (PST) X-Google-Smtp-Source: AH8x224y8uWgWK7QZB4QQ/TXLwmubICEU/wCN11tB75UkGHUuqDAxhozo73vAtxRiNqB2TsvNxoK X-Received: by 10.99.147.70 with SMTP id w6mr4378387pgm.410.1516528363015; Sun, 21 Jan 2018 01:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516528362; cv=none; d=google.com; s=arc-20160816; b=ePZomWTiz6oup7j3hjxb0ycEu0mkc47HgrGYAsylfrh7BSaQUxc/ucBn0sdK5UqO8L yG1iUoXlKwSElKIZBGUYUNvmGpD/CltNInrPrbwtcYHz9a5WbzJFALDSPs1l40nfAEaH 7t3MN1yTkbZvRKBEpHccFL0oHxpSES4GdkLAufIJPRmzfsnN97vA7LFL0gO0Eo/X2FPY B9M4RNkEJFZJz9ISusNpnRSPfiZUix8c/rIKpA3wyWQwoBRsyU++jONMEjD85zOFOKpA B4twd3OgZS479qChY4F7CgrGOhw7jvD5GA66P50sqa1/1OWmNZNTTCTigUiuP7+bgmNF BWyg== 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=DaxbwME+Dxlcj672qE9wTVJAZqSn8lMcsvXNTIA6Cus=; b=ZBcJlsuTrp3qJCAbb/WiSU4EQ6O2ICAm9kuZZ/mGU9WhZpyFzHSknNUooaQ6Z+gxlf wXUDmFLUQe2v+uC6svsHwr3hOe/ee/6yK4gIGvgdewx7ydkd8Es5EgbcF+dfaVRKVNas jHidVYZt1Pih0ILv6NQ4eAG9a3WKhXH2o1lBPWSjenYsHnNPybraD/tVX2M2yUBdb/TT ZGrOIEWx8aTPWatIrQ6cCkcGEs6bFzz/n75MH4sDEcA5gNpoFklL3eZynotoQLTklZth WAdWcHuGNXfIT1YKntV1wlq1xw+J5xZTnv16kGHBZzfs8u07e8WcaTLCa7FpjRykv+MA AI4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=dR6j5MhS; 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 r16si13267159pfe.369.2018.01.21.01.52.29; Sun, 21 Jan 2018 01:52:42 -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=dR6j5MhS; 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 S1751347AbeAUJvG (ORCPT + 99 others); Sun, 21 Jan 2018 04:51:06 -0500 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:57009 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbeAUJvF (ORCPT ); Sun, 21 Jan 2018 04:51:05 -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=1516528265; x=1548064265; h=from:to:subject:date:message-id:in-reply-to:references; bh=DaxbwME+Dxlcj672qE9wTVJAZqSn8lMcsvXNTIA6Cus=; b=dR6j5MhSEgAIdNA16/uom5JNStvJgywY7PrVewre6W9FC8PmPrmuQBMz r0G9KM5ZKf9o/UmxotLsCQGhIXBn1Ssp91waExWS/rdC/2COE1zjyo8HS d8rNCXtlQ9YOBGXIZHjKSMlaG1Ab2NjhIxlQfvae77QqY4bI2Lvhqq/zh 4=; X-IronPort-AV: E=Sophos;i="5.46,390,1511827200"; d="scan'208";a="720512082" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2c-5f221cf9.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jan 2018 09:49:37 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2c-5f221cf9.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w0L9nOIu012955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Jan 2018 09:49:26 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 w0L9nNmj010301; Sun, 21 Jan 2018 09:49:23 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0L9nMs7010300; Sun, 21 Jan 2018 09:49:22 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 4/8] x86/pti: Do not enable PTI on fixed Intel processors Date: Sun, 21 Jan 2018 09:49:05 +0000 Message-Id: <1516528149-9370-5-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 When they advertise the IA32_ARCH_CAPABILITIES MSR and it has the RDCL_NO bit set, they don't need KPTI either. Signed-off-by: David Woodhouse --- arch/x86/kernel/cpu/common.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e5d66e9..80572ae 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -900,8 +900,13 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) setup_force_cpu_cap(X86_FEATURE_ALWAYS); - if (c->x86_vendor != X86_VENDOR_AMD) - setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN); + if (c->x86_vendor != X86_VENDOR_AMD) { + unsigned long ia32_cap = 0; + if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES)) + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); + if (!(ia32_cap & ARCH_CAP_RDCL_NO)) + setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN); + } setup_force_cpu_bug(X86_BUG_SPECTRE_V1); setup_force_cpu_bug(X86_BUG_SPECTRE_V2); -- 2.7.4