diff options
-rw-r--r-- | Documentation/x86/intel_mpx.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/x86/intel_mpx.txt b/Documentation/x86/intel_mpx.txt index 4472ed2ad921..6ca6e2bd9ae9 100644 --- a/Documentation/x86/intel_mpx.txt +++ b/Documentation/x86/intel_mpx.txt | |||
@@ -30,9 +30,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 | 30 | instrumentation as well as some setup code called early after the app |
31 | starts. New instruction prefixes are noops for old CPUs. | 31 | starts. New instruction prefixes are noops for old CPUs. |
32 | 2) That setup code allocates (virtual) space for the "bounds directory", | 32 | 2) That setup code allocates (virtual) space for the "bounds directory", |
33 | points the "bndcfgu" register to the directory and notifies the kernel | 33 | 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 | 34 | bit) and notifies the kernel (via the new prctl(PR_MPX_ENABLE_MANAGEMENT)) |
35 | MPX. | 35 | that the app will be using MPX. The app must be careful not to access |
36 | the bounds tables between the time when it populates "bndcfgu" and | ||
37 | when it calls the prctl(). This might be hard to guarantee if the app | ||
38 | is compiled with MPX. You can add "__attribute__((bnd_legacy))" to | ||
39 | the function to disable MPX instrumentation to help guarantee this. | ||
40 | Also be careful not to call out to any other code which might be | ||
41 | MPX-instrumented. | ||
36 | 3) The kernel detects that the CPU has MPX, allows the new prctl() to | 42 | 3) 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 | 43 | succeed, and notes the location of the bounds directory. Userspace is |
38 | expected to keep the bounds directory at that locationWe note it | 44 | expected to keep the bounds directory at that locationWe note it |