Received: by 10.223.176.46 with SMTP id f43csp2332928wra; Thu, 25 Jan 2018 08:18:09 -0800 (PST) X-Google-Smtp-Source: AH8x225am3vBkAgvjtet5qMNapj4rEJtVS+jMs616KUTGb2w4fAq4xmpYI7sqmmDZI4rQguRr41T X-Received: by 10.99.117.28 with SMTP id q28mr6617344pgc.37.1516897089341; Thu, 25 Jan 2018 08:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516897089; cv=none; d=google.com; s=arc-20160816; b=Mt/aLfdvgZ6njSzjW6vnmz/IBW99BYj3fEhZ4HZ7fwskn5hVtvUAkiE7RcjfvKTef8 3KrmZc33OETd2U9qYR5hcKo9m+jWHvwKaEfcHl3RoS/zOKC+xqeJplDI2Rt0L4yzzofi Qq19sTI0CXzofvE3EQJ/9/bOiayC6Oz5JTKbkC5beiGZVhDne9XG0zhe5V/2ETVmZ3qb ijj0fkBqGxCxBEJUfOuP9l5ZDfJwN013LyHJSUXHDxykeCL9TMQmv24qgKSYUzFWSO7H AeY7CZzXFmvOZEjHgDyvDfOixbnuGJxwCjjf0R47fScL28pIRdqqGD0fRoU3390NTkhg PUhA== 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:mime-version :message-id:date:subject:to:from:dkim-signature :arc-authentication-results; bh=L3tB6eLUYtafDO7j3ZVM8Nx5jL7u6d5jnq+ibS+v8TU=; b=vT05SNl3rRlV00S2Bb89hTaq9qJBVFPJAKPwdUog/mePS9xri3wOH4q6rwJKyXaPgO ZzZ3IOG7WjgW90uTDBxVxvDl0ZBWHuChWpxKDFpiwMA+8GpTghb0w04YDx6u9NcUiY7G h9y1lX/av2GrR6LeRO2425mAJfqF5rubLzYIclUU8BB7AvU7zoZ3/6lEYiL2X39WXgJm f+6ONkCvleATXIQMrmc5+Nlyql7DAjD4qbrdp7BmY20dOarj7sjsqWuOTMRDxrjHlGL9 VC+7Jw8e5FCxsBIwAsBUNtrtjJAedrgL6evW+2QQG/ExWXq4LDR9dKUWY5JAOpNud1LY 39qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=OCJXbnh6; 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 94-v6si2173997ple.413.2018.01.25.08.17.55; Thu, 25 Jan 2018 08:18: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; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=OCJXbnh6; 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 S1751176AbeAYQOi (ORCPT + 99 others); Thu, 25 Jan 2018 11:14:38 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:43462 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeAYQOh (ORCPT ); Thu, 25 Jan 2018 11:14:37 -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=1516896876; x=1548432876; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=L3tB6eLUYtafDO7j3ZVM8Nx5jL7u6d5jnq+ibS+v8TU=; b=OCJXbnh6RIwnqphb9NkVh4cWd2jpKwUJxtzYNXjo3RMqzGTMni8gpyls n5hijLB1HzhW6jDVbPiNNdkurkuYbpgtKhqUFYBrjQ6dzw42HNJ1SvC0C vvRNjpY9yP7EX1AjBTfWynuuDPod2JtdE5uN9wAr9gbaQ4FRzlIsvIpV0 w=; X-IronPort-AV: E=Sophos;i="5.46,412,1511827200"; d="scan'208";a="705292071" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-53356bf6.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Jan 2018 16:14:28 +0000 Received: from uc8d3ff76b9bc5848a9cc.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2a-53356bf6.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w0PGEMD4079762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Jan 2018 16:14:24 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 w0PGEKpL008029; Thu, 25 Jan 2018 16:14:20 GMT Received: (from dwmw@localhost) by uc8d3ff76b9bc5848a9cc.ant.amazon.com (8.15.2/8.15.2/Submit) id w0PGEILq008026; Thu, 25 Jan 2018 16:14:18 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, dave.hansen@intel.com, gnomes@lxorguk.ukuu.org.uk, ashok.raj@intel.com, mingo@kernel.org Subject: [PATCH v5 0/7] Basic Speculation Control feature support Date: Thu, 25 Jan 2018 16:14:08 +0000 Message-Id: <1516896855-7642-1-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the basic CPUID and MSR definitions for AMD and Intel, followed by the complete no-brainer: Disable KPTI on Intel CPUs which set the RDCL_NO bit to say that they don't need it, as well as others which are known not to speculate such as old Atoms and even older 32-bit chips. Alan will continue an archæological dig to round up some more entries for that table. Also blacklist the early Intel microcodes for Spectre mitigation features, and add the basic support for indirect_branch_prediction_barrier(). The latter is needed to protect userspace and complete the retpoline-based mitigation. Patches on top of it are being bikeshedded as we speak... v2: Cleanups, add AMD bits for STIBP/SPEC_CTRL. v3: Add more CPUs to the exemption for KPTI and clean that up. Add microcode blacklist (RFC). v4: Roll in 'no speculation' list for CPUs not vulnerable to Spectre. Cosmetic cleanups in microcode blacklist table. v5: Update bad KBL microcode revision, blacklist all new features. Add NSC to no_speculation list. David Woodhouse (7): x86/cpufeatures: Add CPUID_7_EDX CPUID leaf x86/cpufeatures: Add Intel feature bits for Speculation Control x86/cpufeatures: Add AMD feature bits for Speculation Control x86/msr: Add definitions for new speculation control MSRs x86/pti: Do not enable PTI on processors which are not vulnerable to Meltdown x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support arch/x86/include/asm/cpufeature.h | 7 +++- arch/x86/include/asm/cpufeatures.h | 15 ++++++-- arch/x86/include/asm/disabled-features.h | 3 +- arch/x86/include/asm/msr-index.h | 12 ++++++ arch/x86/include/asm/nospec-branch.h | 13 +++++++ arch/x86/include/asm/required-features.h | 3 +- arch/x86/kernel/cpu/bugs.c | 7 ++++ arch/x86/kernel/cpu/common.c | 49 +++++++++++++++++++++--- arch/x86/kernel/cpu/intel.c | 66 ++++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/scattered.c | 2 - 10 files changed, 163 insertions(+), 14 deletions(-) -- 2.7.4