lkml.org 
[lkml]   [2015]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/12] mm: Pass the 4-bit protection key in via PROT_ bits to syscalls
> diff -puN include/uapi/asm-generic/mman-common.h~pkeys-11-user-abi-bits include/uapi/asm-generic/mman-common.h
> --- a/include/uapi/asm-generic/mman-common.h~pkeys-11-user-abi-bits 2015-05-07 10:31:43.367276719 -0700
> +++ b/include/uapi/asm-generic/mman-common.h 2015-05-07 10:31:43.370276855 -0700
> @@ -10,6 +10,10 @@
> #define PROT_WRITE 0x2 /* page can be written */
> #define PROT_EXEC 0x4 /* page can be executed */
> #define PROT_SEM 0x8 /* page may be used for atomic ops */
> +#define PROT_PKEY0 0x10 /* protection key value (bit 0) */
> +#define PROT_PKEY1 0x20 /* protection key value (bit 1) */
> +#define PROT_PKEY2 0x40 /* protection key value (bit 2) */
> +#define PROT_PKEY3 0x80 /* protection key value (bit 3) */

Thats leaking deep Intelisms into asm-generic which makes me very
uncomfortable. Whether we need to reserve some bits for "arch specific"
is one question, what we do with them ought not to be leaking out.

To start with trying to port code people will want to do

#define PROT_PKEY0 0
#define PROT_PKEY1 0
..

etc



\
 
 \ /
  Last update: 2015-05-07 21:21    [W:0.115 / U:4.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site