lkml.org 
[lkml]   [2015]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 08/17] x86, mpx: boot-time disable
From
Date

From: Dave Hansen <dave.hansen@linux.intel.com>

MPX has the _potential_ to cause some issues. Say part of your init
system tried to protect one of its components from buffer overflows
with MPX. If there were a false positive, it's possible that MPX
could keep a system from booting.

MPX could also potentially cause performance issues since it is
present in hot paths like the unmap path.

Allow it to be disabled at boot time.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

b/Documentation/kernel-parameters.txt | 4 ++++
b/arch/x86/kernel/cpu/common.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+)

diff -puN arch/x86/kernel/cpu/common.c~x86-mpx-disable-boot-time arch/x86/kernel/cpu/common.c
--- a/arch/x86/kernel/cpu/common.c~x86-mpx-disable-boot-time 2015-03-27 14:35:06.804853764 -0700
+++ b/arch/x86/kernel/cpu/common.c 2015-03-27 14:35:06.809853989 -0700
@@ -172,6 +172,22 @@ static int __init x86_xsaves_setup(char
}
__setup("noxsaves", x86_xsaves_setup);

+static int __init x86_mpx_setup(char *s)
+{
+ /* require an exact match without trailing characters */
+ if (strlen(s))
+ return 0;
+
+ /* do not emit a message if the feature is not present */
+ if (!boot_cpu_has(X86_FEATURE_MPX))
+ return 1;
+
+ setup_clear_cpu_cap(X86_FEATURE_MPX);
+ pr_info("nompx: Intel Memory Protection Extensions (MPX) disabled\n");
+ return 1;
+}
+__setup("nompx", x86_mpx_setup);
+
#ifdef CONFIG_X86_32
static int cachesize_override = -1;
static int disable_x86_serial_nr = 1;
diff -puN Documentation/kernel-parameters.txt~x86-mpx-disable-boot-time Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt~x86-mpx-disable-boot-time 2015-03-27 14:35:06.806853854 -0700
+++ b/Documentation/kernel-parameters.txt 2015-03-27 14:35:06.811854080 -0700
@@ -2340,6 +2340,10 @@ bytes respectively. Such letter suffixes
parameter, xsave area per process might occupy more
memory on xsaves enabled systems.

+ nompx [X86] Disables Intel Memory Protection Extensions.
+ See Documentation/x86/intel_mpx.txt for more
+ information about the feature.
+
eagerfpu= [X86]
on enable eager fpu restore
off disable eager fpu restore
_

\
 
 \ /
  Last update: 2015-03-27 23:01    [W:0.135 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site