From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757820AbcBIQJ1 (ORCPT ); Tue, 9 Feb 2016 11:09:27 -0500 Received: from terminus.zytor.com ([198.137.202.10]:38416 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757798AbcBIQJY (ORCPT ); Tue, 9 Feb 2016 11:09:24 -0500 Date: Tue, 9 Feb 2016 08:07:52 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: dave.hansen@linux.intel.com, bp@alien8.de, luto@kernel.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, luto@amacapital.net, aryabinin@virtuozzo.com, dvlasenk@redhat.com, bp@suse.de, peterz@infradead.org, torvalds@linux-foundation.org, toshi.kani@hp.com, mcgrof@suse.com, oleg@redhat.com, brgerst@gmail.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, bp@suse.de, aryabinin@virtuozzo.com, dvlasenk@redhat.com, luto@amacapital.net, tglx@linutronix.de, hpa@zytor.com, oleg@redhat.com, brgerst@gmail.com, toshi.kani@hp.com, torvalds@linux-foundation.org, mcgrof@suse.com, peterz@infradead.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/mm: Add a 'noinvpcid' boot option to turn off INVPCID Git-Commit-ID: d12a72b844a49d4162f24cefdab30bed3f86730e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d12a72b844a49d4162f24cefdab30bed3f86730e Gitweb: http://git.kernel.org/tip/d12a72b844a49d4162f24cefdab30bed3f86730e Author: Andy Lutomirski AuthorDate: Fri, 29 Jan 2016 11:42:58 -0800 Committer: Ingo Molnar CommitDate: Tue, 9 Feb 2016 13:36:10 +0100 x86/mm: Add a 'noinvpcid' boot option to turn off INVPCID This adds a chicken bit to turn off INVPCID in case something goes wrong. It's an early_param() because we do TLB flushes before we parse __setup() parameters. Signed-off-by: Andy Lutomirski Reviewed-by: Borislav Petkov Cc: Andrew Morton Cc: Andrey Ryabinin Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Luis R. Rodriguez Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Toshi Kani Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/f586317ed1bc2b87aee652267e515b90051af385.1454096309.git.luto@kernel.org Signed-off-by: Ingo Molnar --- Documentation/kernel-parameters.txt | 2 ++ arch/x86/kernel/cpu/common.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 551ecf0..e4c4d2a 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2566,6 +2566,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. nointroute [IA-64] + noinvpcid [X86] Disable the INVPCID cpu feature. + nojitter [IA-64] Disables jitter checking for ITC timers. no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 37830de..f4d0aa6 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -162,6 +162,22 @@ static int __init x86_mpx_setup(char *s) } __setup("nompx", x86_mpx_setup); +static int __init x86_noinvpcid_setup(char *s) +{ + /* noinvpcid doesn't accept parameters */ + if (s) + return -EINVAL; + + /* do not emit a message if the feature is not present */ + if (!boot_cpu_has(X86_FEATURE_INVPCID)) + return 0; + + setup_clear_cpu_cap(X86_FEATURE_INVPCID); + pr_info("noinvpcid: INVPCID feature disabled\n"); + return 0; +} +early_param("noinvpcid", x86_noinvpcid_setup); + #ifdef CONFIG_X86_32 static int cachesize_override = -1; static int disable_x86_serial_nr = 1;