Received: by 10.223.176.46 with SMTP id f43csp748561wra; Sat, 20 Jan 2018 04:07:34 -0800 (PST) X-Google-Smtp-Source: AH8x224bycCgy2EHWWcfdjTSA2LBTGNkk4pG7oUTydK0OPMlFUhSQ4SznEAgknQcE1SorhA4XWen X-Received: by 2002:a17:902:7c95:: with SMTP id y21-v6mr841958pll.70.1516450054834; Sat, 20 Jan 2018 04:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516450054; cv=none; d=google.com; s=arc-20160816; b=PL3lliv9xYzlRZBo4k0kDkoeXma0/33KEzgcmHdShD32YmcmpR0KukQtph4YV2xMAu oREW0r4EPtgyx9V9QIqTXy9+iROgewFrAuSDqwGDKXVzQDLVV1b9PdfdfU/lrx8rof5B 4kdS/z0C+3zkxJuS3spnmwAbEOVmXY/38c4QOlZs4xkkYlLS0cfnKeSw3yKWtzqgBwEA cfxYHEZ39bB7Pi6JCPFs57xB62DRJghKD4DdCYe0io/DPdRzSa5vFgORoKsgL+kFeFWS vBmKIkUPaQ2BpWbA9n6yRpMWg9pdiy+Gb+maow3hipwFJKFcVYBuKU3RT2z6acz5CrXP K44g== 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=HFVmeMbK+784MyQkL5DXN7ZpMDWKMaXA+7Oqh1+RM2BC6kfEAWDTFdwtnmCoEu3YS9 EoqmVIKd7PznO5A+eW55Ge0q8JM4OsjPj3x/ijVyFdphgI6+oMp2D3pF+nnKWJoBPjKz lgmu1tZ9IGFjXFhmvWXgyF+T0xOcFQC+t3el48pFovQ+HMSd4UOpEd29e8s5oY8xqwmg tTRV4FNykcYmSkdnvRqwGjYOJnten9K4ZYe0GiTLHQ9C5yWTYbIuq+FIP4a8pUBVWqiG 4cu78bRKnMHGfxgDAdsg/YMaySW3bWhMfvqrLww67gka7rbk0wA4XiK/wOhowVEP+G/7 hR2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=YyNb4pZk; 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 l26si11364905pfj.401.2018.01.20.04.06.47; Sat, 20 Jan 2018 04:07:34 -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=YyNb4pZk; 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 S1754993AbeATMFq (ORCPT + 99 others); Sat, 20 Jan 2018 07:05:46 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:57661 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbeATMFl (ORCPT ); Sat, 20 Jan 2018 07:05:41 -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=1516449940; x=1547985940; h=from:to:subject:date:message-id:in-reply-to:references; bh=DaxbwME+Dxlcj672qE9wTVJAZqSn8lMcsvXNTIA6Cus=; b=YyNb4pZkAuXwiqqvGBulPJmCFilrM4TSTfFdqXgwm/EVQWE16iKTFjr9 9o1jf3GTl2S1U+Q9XJ6MK07LS1kFfjupYbqiE41EYRwWQqx1er2YYayPS f9RhdFkZ8lAZcXIH2Txw6+5JLaFv7y9Rob/pc26HsGpUm1ldKfrTEHh1m k=; X-IronPort-AV: E=Sophos;i="5.46,386,1511827200"; d="scan'208";a="665670543" Received: from iad6-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2a-538b0bfb.us-west-2.amazon.com) ([10.124.125.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jan 2018 12:04:04 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (pdx2-ws-svc-lb17-vlan2.amazon.com [10.247.140.66]) by email-inbound-relay-2a-538b0bfb.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w0KC3lch039525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Jan 2018 12:03:49 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 w0KC3kFm007845; Sat, 20 Jan 2018 12:03:46 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0KC3jnr007844; Sat, 20 Jan 2018 12:03:45 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 4/4] x86/pti: Do not enable PTI on fixed Intel processors Date: Sat, 20 Jan 2018 12:03:33 +0000 Message-Id: <1516449813-7654-5-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516449813-7654-1-git-send-email-dwmw@amazon.co.uk> References: <1516449813-7654-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