Skip to content

Commit

Permalink
x86/pkeys: Update documentation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
davehansenintel authored and KAGA-KOKO committed Oct 5, 2016
1 parent ba6d018 commit 6679dac
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Documentation/x86/protection-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ instruction fetches.

=========================== Syscalls ===========================

There are 2 system calls which directly interact with pkeys:
There are 3 system calls which directly interact with pkeys:

int pkey_alloc(unsigned long flags, unsigned long init_access_rights)
int pkey_free(int pkey);
Expand Down Expand Up @@ -52,6 +52,10 @@ is no longer in use:
munmap(ptr, PAGE_SIZE);
pkey_free(pkey);

(Note: pkey_set() is a wrapper for the RDPKRU and WRPKRU instructions.
An example implementation can be found in
tools/testing/selftests/x86/protection_keys.c)

=========================== Behavior ===========================

The kernel attempts to make protection keys consistent with the
Expand Down Expand Up @@ -79,11 +83,3 @@ with a read():
The kernel will send a SIGSEGV in both cases, but si_code will be set
to SEGV_PKERR when violating protection keys versus SEGV_ACCERR when
the plain mprotect() permissions are violated.

=========================== Config Option ===========================

This config option adds approximately 1.5kb of text. and 50 bytes of
data to the executable. A workload which does large O_DIRECT reads
of holes in XFS files was run to exercise get_user_pages_fast(). No
performance delta was observed with the config option
enabled or disabled.

0 comments on commit 6679dac

Please sign in to comment.