aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/x86/intel_mpx.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/x86/intel_mpx.txt b/Documentation/x86/intel_mpx.txt
index 4472ed2ad921..818518a3ff01 100644
--- a/Documentation/x86/intel_mpx.txt
+++ b/Documentation/x86/intel_mpx.txt
@@ -7,11 +7,15 @@ that can be used in conjunction with compiler changes to check memory
7references, for those references whose compile-time normal intentions are 7references, for those references whose compile-time normal intentions are
8usurped at runtime due to buffer overflow or underflow. 8usurped at runtime due to buffer overflow or underflow.
9 9
10You can tell if your CPU supports MPX by looking in /proc/cpuinfo:
11
12 cat /proc/cpuinfo | grep ' mpx '
13
10For more information, please refer to Intel(R) Architecture Instruction 14For more information, please refer to Intel(R) Architecture Instruction
11Set Extensions Programming Reference, Chapter 9: Intel(R) Memory Protection 15Set Extensions Programming Reference, Chapter 9: Intel(R) Memory Protection
12Extensions. 16Extensions.
13 17
14Note: Currently no hardware with MPX ISA is available but it is always 18Note: As of December 2014, no hardware with MPX is available but it is
15possible to use SDE (Intel(R) Software Development Emulator) instead, which 19possible to use SDE (Intel(R) Software Development Emulator) instead, which
16can be downloaded from 20can be downloaded from
17http://software.intel.com/en-us/articles/intel-software-development-emulator 21http://software.intel.com/en-us/articles/intel-software-development-emulator
@@ -30,9 +34,15 @@ is how we expect the compiler, application and kernel to work together.
30 instrumentation as well as some setup code called early after the app 34 instrumentation as well as some setup code called early after the app
31 starts. New instruction prefixes are noops for old CPUs. 35 starts. New instruction prefixes are noops for old CPUs.
322) That setup code allocates (virtual) space for the "bounds directory", 362) That setup code allocates (virtual) space for the "bounds directory",
33 points the "bndcfgu" register to the directory and notifies the kernel 37 points the "bndcfgu" register to the directory (must also set the valid
34 (via the new prctl(PR_MPX_ENABLE_MANAGEMENT)) that the app will be using 38 bit) and notifies the kernel (via the new prctl(PR_MPX_ENABLE_MANAGEMENT))
35 MPX. 39 that the app will be using MPX. The app must be careful not to access
40 the bounds tables between the time when it populates "bndcfgu" and
41 when it calls the prctl(). This might be hard to guarantee if the app
42 is compiled with MPX. You can add "__attribute__((bnd_legacy))" to
43 the function to disable MPX instrumentation to help guarantee this.
44 Also be careful not to call out to any other code which might be
45 MPX-instrumented.
363) The kernel detects that the CPU has MPX, allows the new prctl() to 463) The kernel detects that the CPU has MPX, allows the new prctl() to
37 succeed, and notes the location of the bounds directory. Userspace is 47 succeed, and notes the location of the bounds directory. Userspace is
38 expected to keep the bounds directory at that locationWe note it 48 expected to keep the bounds directory at that locationWe note it