Received: by 10.223.176.46 with SMTP id f43csp1158933wra; Sat, 20 Jan 2018 12:10:09 -0800 (PST) X-Google-Smtp-Source: AH8x224U5PxtBWI6qGl7mH7nVoiVsJoAQJzV9NfuiunAnDFsTZYiRqWUTHA7pjmNlWeLo7WIP1ks X-Received: by 10.98.200.78 with SMTP id z75mr3350772pff.114.1516479009784; Sat, 20 Jan 2018 12:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516479009; cv=none; d=google.com; s=arc-20160816; b=qYl59nJK5X2QtFb88WCOvKo6yHjWaCHC77AqayTTb8le6Z/7w10ZiUarAoCQa296O3 zJk/9DpkUavuATMZ7p/6DxqYDarQaP5KT1mSodZ6mT4Leh7cO3p6JTfEF22P9UfwrYZT iHehA5oWelV+DlqZ/zY2JLtK+UEEIn0XCYV3icEsctb+eG7HV3arO9uFWN6mhATH3tqU e0G07x5/LLKp/jO5SmQncURRy2euCUbybdKyBtlp/BZAIvSrqtqm4y2IcfxyHeSgZvNP MMPAIMku4wXn24NFNYzpyQDMtXo8ssORA8gXTvFX9rimkARo81Lq+vd5baJD8DPC5IKf DHKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=NTyvqzK6wS56aTrsgNiTCLVNCx8U9SUmeI/ZDt3yRcc=; b=py1kkMCZUAn6vPW2Zb7xsnkrrTlIsZamezWTre3MG1JmSFU1V3QBJGwazYxq4VG8uG +ccmshhpx4CYXNC7KlRxZvqvpjuOYBbjF2pv7YkfDx2040bv/RvHVcO2KPCpZNyq2QEN OMciKxKBT3JpWaSjLtGKcrzk5AJAmg2klZF8+jgmjFF50GhHUfquu4VHmw3rk0cTIV5T cgm8WhszB0xFXyXwr41NM7enaPZ8cRU2IuT8vVTijQ2HgRVE2FcsL2ifJVUzIa4tzZ6I 2J7Q1xDY1sGu9E34+G6RtRXQ7I9hOrCbAYv0f9Rdss9JazIqo3D6G7zwD3QVla5jQzoE 8+Lw== 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 j14si3163653pgf.585.2018.01.20.12.09.54; Sat, 20 Jan 2018 12:10:09 -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 S1756636AbeATUIU (ORCPT + 99 others); Sat, 20 Jan 2018 15:08:20 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53165 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756548AbeATUIQ (ORCPT ); Sat, 20 Jan 2018 15:08:16 -0500 Received: from p4fea5f09.dip0.t-ipconnect.de ([79.234.95.9] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eczOT-0007yc-KD; Sat, 20 Jan 2018 21:05:37 +0100 Date: Sat, 20 Jan 2018 21:08:11 +0100 (CET) From: Thomas Gleixner To: David Woodhouse cc: arjan@linux.intel.com, 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: Re: [PATCH 4/4] x86/pti: Do not enable PTI on fixed Intel processors In-Reply-To: <1516449813-7654-5-git-send-email-dwmw@amazon.co.uk> Message-ID: References: <1516449813-7654-1-git-send-email-dwmw@amazon.co.uk> <1516449813-7654-5-git-send-email-dwmw@amazon.co.uk> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 20 Jan 2018, David Woodhouse wrote: > When they advertise the IA32_ARCH_CAPABILITIES MSR and it has the RDCL_NO > bit set, they don't need KPTI either. Do they exist today? And do we have documentation for that new MSR already? Thanks, tglx > 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 > >