GNU Linux-libre 4.9.309-gnu1
[releases.git] / arch / x86 / include / asm / mmu.h
1 #ifndef _ASM_X86_MMU_H
2 #define _ASM_X86_MMU_H
3
4 #include <linux/spinlock.h>
5 #include <linux/mutex.h>
6 #include <linux/atomic.h>
7
8 /*
9  * x86 has arch-specific MMU state beyond what lives in mm_struct.
10  */
11 typedef struct {
12         /*
13          * ctx_id uniquely identifies this mm_struct.  A ctx_id will never
14          * be reused, and zero is not a valid ctx_id.
15          */
16         u64 ctx_id;
17
18 #ifdef CONFIG_MODIFY_LDT_SYSCALL
19         struct ldt_struct *ldt;
20 #endif
21
22 #ifdef CONFIG_X86_64
23         /* True if mm supports a task running in 32 bit compatibility mode. */
24         unsigned short ia32_compat;
25 #endif
26
27         struct mutex lock;
28         void __user *vdso;                      /* vdso base address */
29         const struct vdso_image *vdso_image;    /* vdso image in use */
30
31         atomic_t perf_rdpmc_allowed;    /* nonzero if rdpmc is allowed */
32 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
33         /*
34          * One bit per protection key says whether userspace can
35          * use it or not.  protected by mmap_sem.
36          */
37         u16 pkey_allocation_map;
38         s16 execute_only_pkey;
39 #endif
40 } mm_context_t;
41
42 #define INIT_MM_CONTEXT(mm)                                             \
43         .context = {                                                    \
44                 .ctx_id = 1,                                            \
45         }
46
47 void leave_mm(int cpu);
48
49 #endif /* _ASM_X86_MMU_H */