linux/arch/x86/include/uapi/asm
Dave Hansen 8f62c88322 x86/mm/pkeys: Add arch-specific VMA protection bits
Lots of things seem to do:

        vma->vm_page_prot = vm_get_page_prot(flags);

and the ptes get created right from things we pull out
of ->vm_page_prot.  So it is very convenient if we can
store the protection key in flags and vm_page_prot, just
like the existing permission bits (_PAGE_RW/PRESENT).  It
greatly reduces the amount of plumbing and arch-specific
hacking we have to do in generic code.

This also takes the new PROT_PKEY{0,1,2,3} flags and
turns *those* in to VM_ flags for vma->vm_flags.

The protection key values are stored in 4 places:
	1. "prot" argument to system calls
	2. vma->vm_flags, filled from the mmap "prot"
	3. vma->vm_page prot, filled from vma->vm_flags
	4. the PTE itself.

The pseudocode for these for steps are as follows:

	mmap(PROT_PKEY*)
	vma->vm_flags 	  = ... | arch_calc_vm_prot_bits(mmap_prot);
	vma->vm_page_prot = ... | arch_vm_get_page_prot(vma->vm_flags);
	pte = pfn | vma->vm_page_prot

Note that this provides a new definitions for x86:

	arch_vm_get_page_prot()

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20160212210210.FE483A42@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-02-18 09:31:51 +01:00
..
a.out.h
auxvec.h
bitsperlong.h x86/headers/uapi: Fix __BITS_PER_LONG value for x32 builds 2015-10-02 09:43:21 +02:00
boot.h
bootparam.h x86/boot: Obsolete the MCA sys_desc_table 2015-07-21 10:55:11 +02:00
byteorder.h
debugreg.h
e820.h libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option 2015-08-19 00:34:34 -04:00
errno.h
fcntl.h
hw_breakpoint.h create non-empty arch/x86/include/uapi/asm/ files 2012-12-17 17:15:11 -08:00
hyperv.h kvm/x86: Hyper-V SynIC timers 2015-12-16 18:49:45 +01:00
ioctl.h
ioctls.h
ipcbuf.h
ist.h
Kbuild perf kvm: Use defines of kvm events 2014-07-16 17:57:32 -03:00
kvm_para.h kvm uapi: Add KICK_CPU and PV_UNHALT definition to uapi 2013-08-26 12:46:01 +03:00
kvm_perf.h perf kvm: Use defines of kvm events 2014-07-16 17:57:32 -03:00
kvm.h KVM: x86: rename quirk constants to KVM_X86_QUIRK_* 2015-07-23 08:24:42 +02:00
ldt.h x86/tls: Don't validate lm in set_thread_area() after all 2014-12-18 12:12:26 +01:00
mce.h x86/RAS: Remove mce.usable_addr 2015-11-24 09:12:35 +01:00
mman.h x86/mm/pkeys: Add arch-specific VMA protection bits 2016-02-18 09:31:51 +01:00
msgbuf.h
msr.h x86/uapi: Do not export <asm/msr-index.h> as part of the user API headers 2015-06-07 15:36:04 +02:00
mtrr.h x86/mm/mtrr: Use symbolic define as a retval for disabled MTRRs 2015-05-27 14:40:57 +02:00
param.h
perf_regs.h
poll.h
posix_types_32.h
posix_types_64.h
posix_types_x32.h
posix_types.h
prctl.h
processor-flags.h x86/cpu, x86/mm/pkeys: Define new CR4 bit 2016-02-16 10:11:14 +01:00
ptrace-abi.h x86/asm/entry/64: Fix comments 2015-03-04 22:50:49 +01:00
ptrace.h x86/asm/entry/64: Fix comments 2015-03-04 22:50:49 +01:00
resource.h
sembuf.h x86, uapi, x32: Use __kernel_ulong_t in x86 struct semid64_ds 2014-01-20 14:45:13 -08:00
setup.h create non-empty arch/x86/include/uapi/asm/ files 2012-12-17 17:15:11 -08:00
shmbuf.h
sigcontext32.h x86/headers: Remove direct sigcontext32.h uses 2015-09-08 10:03:59 +02:00
sigcontext.h x86/headers: Clean up too long lines 2015-09-14 11:09:33 +02:00
siginfo.h
signal.h consolidate kernel-side struct sigaction declarations 2013-02-03 15:09:22 -05:00
socket.h
sockios.h
stat.h x86, x32: Use __kernel_long_t/__kernel_ulong_t in x86-64 stat.h 2013-12-20 16:04:35 -08:00
statfs.h
svm.h KVM: x86: work around infinite loop in microcode when #AC is delivered 2015-11-10 12:06:24 +01:00
swab.h
termbits.h
termios.h
types.h
ucontext.h
unistd.h
vm86.h
vmx.h KVM: x86: add pcommit support 2015-10-01 15:06:35 +02:00
vsyscall.h x86, vdso: Move the vvar and hpet mappings next to the 64-bit vDSO 2014-05-05 13:19:01 -07:00