diff options
author | Dave Hansen <dave.hansen@intel.com> | 2016-10-04 12:38:57 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-10-05 04:34:55 -0400 |
commit | 6679dac513fd612f34d3a3d99d7b84ed6d5eb5cc (patch) | |
tree | 86d7b892cbf634bc83bf2a9ab3619d7d5709de97 /Documentation/x86/protection-keys.txt | |
parent | ba6d018e3d2f6a0fad58a668cadf66b2d1f80f59 (diff) |
x86/pkeys: Update documentation
There are a few items that have gotten stale in the protection
keys documentation. The config option description only applied
to the execute-only support and is not accurate for the current
code. There was also a typo with the number of system calls. I
also wanted to call out that pkey_set() is not a kernel-provided
facility, and where to find an implementation.
Signed-off-by: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: linux-doc@vger.kernel.org
Cc: corbet@lwn.net
Link: http://lkml.kernel.org/r/20161004163857.71E0D6F6@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/x86/protection-keys.txt')
-rw-r--r-- | Documentation/x86/protection-keys.txt | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Documentation/x86/protection-keys.txt b/Documentation/x86/protection-keys.txt index 6da7689601d1..b64304540821 100644 --- a/Documentation/x86/protection-keys.txt +++ b/Documentation/x86/protection-keys.txt | |||
@@ -20,7 +20,7 @@ instruction fetches. | |||
20 | 20 | ||
21 | =========================== Syscalls =========================== | 21 | =========================== Syscalls =========================== |
22 | 22 | ||
23 | There are 2 system calls which directly interact with pkeys: | 23 | There are 3 system calls which directly interact with pkeys: |
24 | 24 | ||
25 | int pkey_alloc(unsigned long flags, unsigned long init_access_rights) | 25 | int pkey_alloc(unsigned long flags, unsigned long init_access_rights) |
26 | int pkey_free(int pkey); | 26 | int pkey_free(int pkey); |
@@ -52,6 +52,10 @@ is no longer in use: | |||
52 | munmap(ptr, PAGE_SIZE); | 52 | munmap(ptr, PAGE_SIZE); |
53 | pkey_free(pkey); | 53 | pkey_free(pkey); |
54 | 54 | ||
55 | (Note: pkey_set() is a wrapper for the RDPKRU and WRPKRU instructions. | ||
56 | An example implementation can be found in | ||
57 | tools/testing/selftests/x86/protection_keys.c) | ||
58 | |||
55 | =========================== Behavior =========================== | 59 | =========================== Behavior =========================== |
56 | 60 | ||
57 | The kernel attempts to make protection keys consistent with the | 61 | The kernel attempts to make protection keys consistent with the |
@@ -79,11 +83,3 @@ with a read(): | |||
79 | The kernel will send a SIGSEGV in both cases, but si_code will be set | 83 | The kernel will send a SIGSEGV in both cases, but si_code will be set |
80 | to SEGV_PKERR when violating protection keys versus SEGV_ACCERR when | 84 | to SEGV_PKERR when violating protection keys versus SEGV_ACCERR when |
81 | the plain mprotect() permissions are violated. | 85 | the plain mprotect() permissions are violated. |
82 | |||
83 | =========================== Config Option =========================== | ||
84 | |||
85 | This config option adds approximately 1.5kb of text. and 50 bytes of | ||
86 | data to the executable. A workload which does large O_DIRECT reads | ||
87 | of holes in XFS files was run to exercise get_user_pages_fast(). No | ||
88 | performance delta was observed with the config option | ||
89 | enabled or disabled. | ||