diff options
author | Andy Lutomirski <luto@kernel.org> | 2016-01-29 14:42:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-02-09 07:36:10 -0500 |
commit | d12a72b844a49d4162f24cefdab30bed3f86730e (patch) | |
tree | b716ed2f914c8999e95c3143fad5aa1a3d6c359a | |
parent | 060a402a1ddb551455ee410de2eadd3349f2801b (diff) |
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 <luto@kernel.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/f586317ed1bc2b87aee652267e515b90051af385.1454096309.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | Documentation/kernel-parameters.txt | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 551ecf09c8dd..e4c4d2a5a28d 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. | |||
2566 | 2566 | ||
2567 | nointroute [IA-64] | 2567 | nointroute [IA-64] |
2568 | 2568 | ||
2569 | noinvpcid [X86] Disable the INVPCID cpu feature. | ||
2570 | |||
2569 | nojitter [IA-64] Disables jitter checking for ITC timers. | 2571 | nojitter [IA-64] Disables jitter checking for ITC timers. |
2570 | 2572 | ||
2571 | no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver | 2573 | 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 37830de8f60a..f4d0aa64d934 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) | |||
162 | } | 162 | } |
163 | __setup("nompx", x86_mpx_setup); | 163 | __setup("nompx", x86_mpx_setup); |
164 | 164 | ||
165 | static int __init x86_noinvpcid_setup(char *s) | ||
166 | { | ||
167 | /* noinvpcid doesn't accept parameters */ | ||
168 | if (s) | ||
169 | return -EINVAL; | ||
170 | |||
171 | /* do not emit a message if the feature is not present */ | ||
172 | if (!boot_cpu_has(X86_FEATURE_INVPCID)) | ||
173 | return 0; | ||
174 | |||
175 | setup_clear_cpu_cap(X86_FEATURE_INVPCID); | ||
176 | pr_info("noinvpcid: INVPCID feature disabled\n"); | ||
177 | return 0; | ||
178 | } | ||
179 | early_param("noinvpcid", x86_noinvpcid_setup); | ||
180 | |||
165 | #ifdef CONFIG_X86_32 | 181 | #ifdef CONFIG_X86_32 |
166 | static int cachesize_override = -1; | 182 | static int cachesize_override = -1; |
167 | static int disable_x86_serial_nr = 1; | 183 | static int disable_x86_serial_nr = 1; |