Received: by 10.223.176.46 with SMTP id f43csp2568622wra; Thu, 25 Jan 2018 11:54:45 -0800 (PST) X-Google-Smtp-Source: AH8x225LwGHx8VGvE8WmebzIJvQmFvF7v1shZbvF2hrgvJPX35RlhrNZSFHhZCaX2oWT0Pr5iaMH X-Received: by 10.98.204.144 with SMTP id j16mr17184354pfk.101.1516910085548; Thu, 25 Jan 2018 11:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516910085; cv=none; d=google.com; s=arc-20160816; b=0GlN7rUEwXRRDhilhn4okuljwjjOjJ+/zhcz9SEPgGmf2xyQPQjH+af4Ebdp/hlvei ic0p81N70w2EF3JWy0TNbHHBG+294kKCqeDI3phN3IO3mE77VhR7eqzZYD97C4gJbXLm 0Q9ygX7Pvu3TkHPvuIbsSpUo+vELk+BVlf6MJqKDuCt1LuCQt0Hqc7KQipdLHzZkaR1m I8CfiHPeWwsE/Z0TUVP30TjCWracM7cdj/NhM4OtunIuTKapfuOgH2fjad/uqCXcRmIa T9A6hNnMyQux0SMWGmQPjljcozKY3/1/4ajgQfOz1jzeGZ2gwGEcImrmu979/c2FnVa8 TGMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:to:from:subject:arc-authentication-results; bh=EUSGHX13zQzz+aavjqxdyu7yRki2KprIG8L9yhJn+do=; b=kYaY5FFZQoFYa7E1Va3Es4VNNioi9v26JDxQFXRbKUTiobHrWv0AiaNG7IX6qjXppO zaWsFSwRhDqqZb8jQC+fkqdUsYUF87jPNAuZ2ycg7DhKEbj5xIbaRoK6AuRk4xvKTY11 MMJVuqcpHYnLRT9kShj/AuEDXBxBq1XaL/6fFMfwwsL9vJ+rciP1wYfzyMTmYd1ye7fP ppvRNv8tr1Fd4uTZVd2kW0boK7xGItYJ5+4kP2o3+ePwIY9j//v2MggQQFh70hCwFQxB HoXLi3zemAffJsIBERXAhL8MT2jtVf5Uckqpqp6P8abAlmn7ubb6fH1V94yUHsTyRX0K ga8Q== 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 k78si5032714pfk.142.2018.01.25.11.54.30; Thu, 25 Jan 2018 11:54:45 -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 S1751247AbeAYTxc (ORCPT + 99 others); Thu, 25 Jan 2018 14:53:32 -0500 Received: from mga11.intel.com ([192.55.52.93]:2637 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbeAYTxb (ORCPT ); Thu, 25 Jan 2018 14:53:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 11:53:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,413,1511856000"; d="scan'208";a="26366201" Received: from ray.jf.intel.com (HELO [10.7.201.17]) ([10.7.201.17]) by orsmga001.jf.intel.com with ESMTP; 25 Jan 2018 11:53:31 -0800 Subject: Re: [PATCH v5 5/7] x86/pti: Do not enable PTI on processors which are not vulnerable to Meltdown From: Dave Hansen To: David Woodhouse , 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, gnomes@lxorguk.ukuu.org.uk, ashok.raj@intel.com, mingo@kernel.org, "Gross, Mark" , "Yang, Fei" References: <1516896855-7642-1-git-send-email-dwmw@amazon.co.uk> <1516896855-7642-6-git-send-email-dwmw@amazon.co.uk> Message-ID: <3f23ff04-f12e-d15b-31e8-6b48f2c13f19@intel.com> Date: Thu, 25 Jan 2018 11:53:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/2018 10:10 AM, Dave Hansen wrote: > On 01/25/2018 08:14 AM, David Woodhouse wrote: >> +static bool __init early_cpu_vulnerable_meltdown(struct cpuinfo_x86 *c) >> +{ >> + u64 ia32_cap = 0; >> + >> + if (x86_match_cpu(cpu_no_meltdown)) >> + return false; >> + >> + if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES)) >> + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); >> + >> + /* Rogue Data Cache Load? No! */ >> + if (ia32_cap & ARCH_CAP_RDCL_NO) >> + return false; >> + >> + return true; >> +} > > Feel free to add my ack on this. It looks fine to me. I'll test and > submit any necessary fixes once I actually get a system that has this bit. Well, that was fast. A system supporting the RDCL_NO bit booted this code. It reported not being affected by meltdown: foo:/sys/devices/system/cpu/vulnerabilities/ # grep . * meltdown:Not affected spectre_v1:Vulnerable spectre_v2:Vulnerable: Minimal generic ASM retpoline foo:/sys/devices/system/cpu/vulnerabilities/ #