Received: by 10.223.176.46 with SMTP id f43csp4502154wra; Tue, 23 Jan 2018 10:12:46 -0800 (PST) X-Google-Smtp-Source: AH8x227Uk8JZuFQlyhY0sIGysFOF6i/ZEU+d+NJhJ9TrAFD4h49xJhiw20EhvL0Uo1tCPBb06mil X-Received: by 10.107.169.78 with SMTP id s75mr4881103ioe.197.1516731165892; Tue, 23 Jan 2018 10:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516731165; cv=none; d=google.com; s=arc-20160816; b=nLugMQv4heGt6Rmclq8QTey33OfG8ON37gf8QZbrl+XNn6Yy0TUtyi/hupj1ob5YlB Yu6RHkoGqORPawdIwWpHnNJjCznasQ3AX7Rj4pKRnOnwtkO03at9c6umEHHEudTKHIRW b+oXgy4kII0fu+Q9T+u1+B0pVdVBGYCDW559YRQ5vU+bEAqyOoSi9L5bvhO9z7tlkOds dsK70eJJK6bIIk8zMx9qSf/4ro5Uoz3RYrI+XN5moWCkcR86Fdp3IgOl3vIWUmkNj7GB RYInrth9EANMArhXlRc7AYDXJa9wer7fBc2iLN4RAlWt/SrEPFGSL9oOB2QkLAcMwAax FEcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6awm+by6E2nKzHMdfDxl/KyGgTjzcwbDlgY5MD63w6w=; b=Bxex5RIFSZ0JvrBFpKbx3ouWu1/AXHXumFLVIeThGzwtYpzRNTgFNKae8xMRgmqkA3 2LX2hCKWjvMzRLTQgiszfffUqMC9GLLqA7zq21ACvz3Cs0CzxEdk1f4qC/vkFxnjXf1Y 4WU0sltWaKeUoCbEGzE72wfNWErr756of1BMDds3IyFeaA71XOnZ1r5E6xKWYEAHFazC 20YUpYTiNeIb8wpJGz726uFDfyaGDysnfYS1PfNEXrOZoozDubDwGE4rR5ZGtKVN308p /zUfaN/dgL3Ava9daXnUGOgCWwP28O7QP11V3xCPV7+IQ1CmilcyrQb95NyAwYTKT+n4 NyvQ== 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 z196si5548625ioz.133.2018.01.23.10.12.32; Tue, 23 Jan 2018 10:12: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 S1752076AbeAWSMN (ORCPT + 99 others); Tue, 23 Jan 2018 13:12:13 -0500 Received: from mga01.intel.com ([192.55.52.88]:10073 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbeAWSML (ORCPT ); Tue, 23 Jan 2018 13:12:11 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 10:12:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,402,1511856000"; d="scan'208";a="168536767" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.35]) by orsmga004.jf.intel.com with ESMTP; 23 Jan 2018 10:12:09 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 321F8300D79; Tue, 23 Jan 2018 10:12:01 -0800 (PST) Date: Tue, 23 Jan 2018 10:12:01 -0800 From: Andi Kleen To: David Woodhouse Cc: 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, torvalds@linux-foundation.org, gregkh@linux-foundation.org, thomas.lendacky@amd.com Subject: Re: [PATCH v2 5/5] x86/pti: Do not enable PTI on fixed Intel processors Message-ID: <20180123181201.GO7844@tassilo.jf.intel.com> References: <1516726375-25168-1-git-send-email-dwmw@amazon.co.uk> <1516726375-25168-6-git-send-email-dwmw@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516726375-25168-6-git-send-email-dwmw@amazon.co.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > - 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); This means that in a hypervisor which passes through the CPUID, but actually doesn't implement the MSR (so rdmsr #GPs and returns 0) it would be cleared. It would be better to usr rdmsrl_safe and check the return value. -Andi