Received: by 10.223.176.46 with SMTP id f43csp4399732wra; Tue, 23 Jan 2018 08:54:47 -0800 (PST) X-Google-Smtp-Source: AH8x225l9lccyXuH1SX+fgymTilXxzLbRFgY/KexZPBNlSeLZvly+ReRA3QM8jf2vWTQNreH2RkS X-Received: by 10.107.107.1 with SMTP id g1mr4365886ioc.63.1516726486989; Tue, 23 Jan 2018 08:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516726486; cv=none; d=google.com; s=arc-20160816; b=e4dDKvMLd5/TgxAwWydj8IH3VocjnxxQKoPCi9xufpSTpnULKZl9fA5Wfvx1ch5hpJ 0Q13hJhNc5LVrKn70QFgqjl1S47Z6zsBG7i9BropcIstWjrHbyIgLb3F+Hhcb8sw1iQz z48Y63YVqWWtq7ZXC6R2rK4Dw44+b7oMGpu+Im+qXt8GeiQCOuQffOlfadLgaHT+us0f k/hff6wCh9OJQSx+C35S0vuls3C46n+0pqDhUR7Z8hiQj85i+iEPyKyp3ccBF6vYGtha BlvmHPYaHTT2WS2Z/5IErDZugidmUJE66+FZY+khww0P4sADPQshANivgjdP/qi70Rrm 9/Xw== 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=/VrIL8hddAXEJ1ytvufxBiST/upNkmMou8RA/wNQ2kc=; b=uFj9qzAwDs5YHkNCzRwVboU7kKUAHMo/KHjwO2SApWjMWVO0DX+cbhcLHFJEwvzHwd q6BYtpzNcppr6KTOHaJ6zM7g2UVt2C03le2pQGVUsW/ZoB0a+ZnMBK9VoZzVmjvUVFBt NvA0FD+Yo649MAPwk9XFBtcagu1jLjrG9TgmIGWl2V3XMBUDiji2yQY5Gm660eTDLbMR Q/OSOVAT6PDMUR5GuwfI881vAnledyr0J2m3zyLIARawvo+XmbLSfBdtWp8zBo1vWpFH Yn8z6HrGb/0+pl4b1+0dAky0ILbzd/hsy8VTbUWg7m9h5Zq9e1BPwYegrtP+sZxCJc2w xG9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=M/Fq7xbK; 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 j4si15306056ioe.7.2018.01.23.08.54.32; Tue, 23 Jan 2018 08:54:46 -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=M/Fq7xbK; 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 S1751834AbeAWQxe (ORCPT + 99 others); Tue, 23 Jan 2018 11:53:34 -0500 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:59109 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbeAWQxb (ORCPT ); Tue, 23 Jan 2018 11:53:31 -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=1516726411; x=1548262411; h=from:to:subject:date:message-id:in-reply-to:references; bh=/VrIL8hddAXEJ1ytvufxBiST/upNkmMou8RA/wNQ2kc=; b=M/Fq7xbK1/9mL7oRUx05e/KBXh06qY0bq9P527I9ty0rbdLSPZhVel31 lL0IFKTmE7ipAoQpe6apM92zjkhO4XC53y5rgKytjXxQQf8cQny1qjjnD Y600db6tl/R5PYFnLuwtJ75rFNaDilK3gz7b8O3Axc1Wx5nuxSEPnf/x+ M=; X-IronPort-AV: E=Sophos;i="5.46,402,1511827200"; d="scan'208";a="589159705" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1e-97fdccfd.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Jan 2018 16:53:29 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (iad1-ws-svc-lb91-vlan3.amazon.com [10.0.103.150]) by email-inbound-relay-1e-97fdccfd.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w0NGrHvZ089297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Jan 2018 16:53:21 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 w0NGrFlH025591; Tue, 23 Jan 2018 16:53:16 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0NGrFvo025590; Tue, 23 Jan 2018 16:53:15 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, thomas.lendacky@amd.com Subject: [PATCH v2 5/5] x86/pti: Do not enable PTI on fixed Intel processors Date: Tue, 23 Jan 2018 16:52:55 +0000 Message-Id: <1516726375-25168-6-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516726375-25168-1-git-send-email-dwmw@amazon.co.uk> References: <1516726375-25168-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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e5d66e9..c05d0fe 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -900,8 +900,14 @@ 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) { + u64 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