1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/spinlock.h>
6 #include <linux/rwsem.h>
7 #include <linux/mutex.h>
8 #include <linux/atomic.h>
9 #include <linux/bits.h>
11 /* Uprobes on this MM assume 32-bit code */
12 #define MM_CONTEXT_UPROBE_IA32 0
13 /* vsyscall page is accessible on this MM */
14 #define MM_CONTEXT_HAS_VSYSCALL 1
15 /* Do not allow changing LAM mode */
16 #define MM_CONTEXT_LOCK_LAM 2
17 /* Allow LAM and SVA coexisting */
18 #define MM_CONTEXT_FORCE_TAGGED_SVA 3
21 * x86 has arch-specific MMU state beyond what lives in mm_struct.
25 * ctx_id uniquely identifies this mm_struct. A ctx_id will never
26 * be reused, and zero is not a valid ctx_id.
31 * Any code that needs to do any sort of TLB flushing for this
32 * mm will first make its changes to the page tables, then
33 * increment tlb_gen, then flush. This lets the low-level
34 * flushing code keep track of what needs flushing.
36 * This is not used on Xen PV.
40 #ifdef CONFIG_MODIFY_LDT_SYSCALL
41 struct rw_semaphore ldt_usr_sem;
42 struct ldt_struct *ldt;
49 #ifdef CONFIG_ADDRESS_MASKING
50 /* Active LAM mode: X86_CR3_LAM_U48 or X86_CR3_LAM_U57 or 0 (disabled) */
51 unsigned long lam_cr3_mask;
53 /* Significant bits of the virtual address. Excludes tag bits. */
58 void __user *vdso; /* vdso base address */
59 const struct vdso_image *vdso_image; /* vdso image in use */
61 atomic_t perf_rdpmc_allowed; /* nonzero if rdpmc is allowed */
62 #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
64 * One bit per protection key says whether userspace can
65 * use it or not. protected by mmap_lock.
67 u16 pkey_allocation_map;
68 s16 execute_only_pkey;
72 #define INIT_MM_CONTEXT(mm) \
75 .lock = __MUTEX_INITIALIZER(mm.context.lock), \
79 #define leave_mm leave_mm
81 #endif /* _ASM_X86_MMU_H */