From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227T4C2xbD4usRTWAbrjStqBFeTdMjJ0RqnK1V/wI5DYPpl3VzY5rzfLnAC96NVamPP6eDo+ ARC-Seal: i=1; a=rsa-sha256; t=1516872214; cv=none; d=google.com; s=arc-20160816; b=VhHPx9j5pGAEuVhDsh8KsJbowKwY2IzVyxwc7T13RV4gZh0LBTjsSxVBCMF7xm97bS ETB23OUwZiL9L+2f8Ba9GpYL5wYsXlBqd8iUb+OP7qCm+dGIXXYe1+bzzPop8B5Kyrtl ypebve9Kdoi2OeiseGtFFubgxteZlW2RRWbNe7EKUEqM2cu+a4lh82FggnKwwXSXdF15 7/o8OAls62jZYhaSDwpZ7de9wIBMizkmzmaK/NOcSwLNO/OH5PwJNQmqPRJ06zusjKII ai45dT5liBkiuIATzVAq7KKcC0+YO5FX+tfAuILFAFhsMjNuBqlLDsW/Bg8t8/pzgPhQ HDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:dkim-signature:arc-authentication-results; bh=tBNZZ1zDUwiJm1OmYzEGmIUCJsnc/RyHj6+aqsOtrWo=; b=WXKn8HkuHPlVk7KH0Tekm8eRBMqw3pkA/QgvwcrQ0wDDQtKBw6AQuNKwVp2iyFfQ5x rdBwZOIL35feaHkwiqt9OfAk5w0BYCn2yXnqsVHOB2IjQJtiRU35/CBZd1LC7SToiOxu KoEI6wE0IIgzCqccrADLYV9jxVqdwOxIFX+rXzBUGCSS3epe6hcfe624h4UEMd4Vbka5 mZxVo/iYAmCfzfTRbbTWWjCyzPJvqvomUQMxG6XzVHDzhIxqMQ6bOpdNzJrxV/dJI8Yx Ono8hI+28YdqWWsgctTC+Ab0oAaUnQf4NWBGYtn32DLckp+Fr1n9Pcrb1ylmhRKp/+xX 1+5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=pfdeQ1Fn; spf=pass (google.com: domain of prvs=556dd1d58=dwmw@amazon.com designates 207.171.184.29 as permitted sender) smtp.mailfrom=prvs=556dd1d58=dwmw@amazon.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=pfdeQ1Fn; spf=pass (google.com: domain of prvs=556dd1d58=dwmw@amazon.com designates 207.171.184.29 as permitted sender) smtp.mailfrom=prvs=556dd1d58=dwmw@amazon.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk X-IronPort-AV: E=Sophos;i="5.46,411,1511827200"; d="scan'208";a="589777905" 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 v4 0/7] Basic Speculation Control feature support Date: Thu, 25 Jan 2018 09:23:02 +0000 Message-Id: <1516872189-16577-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590555799403114446?= X-GMAIL-MSGID: =?utf-8?q?1590555799403114446?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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. 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 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 | 48 ++++++++++++++++++--- arch/x86/kernel/cpu/intel.c | 71 ++++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/scattered.c | 2 - 10 files changed, 167 insertions(+), 14 deletions(-) -- 2.7.4