0001
0002 #ifndef _ASM_X86_MMU_H
0003 #define _ASM_X86_MMU_H
0004
0005 #include <linux/spinlock.h>
0006 #include <linux/rwsem.h>
0007 #include <linux/mutex.h>
0008 #include <linux/atomic.h>
0009 #include <linux/bits.h>
0010
0011
0012 #define MM_CONTEXT_UPROBE_IA32 BIT(0)
0013
0014 #define MM_CONTEXT_HAS_VSYSCALL BIT(1)
0015
0016
0017
0018
0019 typedef struct {
0020
0021
0022
0023
0024 u64 ctx_id;
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 atomic64_t tlb_gen;
0035
0036 #ifdef CONFIG_MODIFY_LDT_SYSCALL
0037 struct rw_semaphore ldt_usr_sem;
0038 struct ldt_struct *ldt;
0039 #endif
0040
0041 #ifdef CONFIG_X86_64
0042 unsigned short flags;
0043 #endif
0044
0045 struct mutex lock;
0046 void __user *vdso;
0047 const struct vdso_image *vdso_image;
0048
0049 atomic_t perf_rdpmc_allowed;
0050 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
0051
0052
0053
0054
0055 u16 pkey_allocation_map;
0056 s16 execute_only_pkey;
0057 #endif
0058 } mm_context_t;
0059
0060 #define INIT_MM_CONTEXT(mm) \
0061 .context = { \
0062 .ctx_id = 1, \
0063 .lock = __MUTEX_INITIALIZER(mm.context.lock), \
0064 }
0065
0066 void leave_mm(int cpu);
0067 #define leave_mm leave_mm
0068
0069 #endif