Lines Matching full:mm

55 static inline void init_new_context_ldt(struct mm_struct *mm)  in init_new_context_ldt()  argument
57 mm->context.ldt = NULL; in init_new_context_ldt()
58 init_rwsem(&mm->context.ldt_usr_sem); in init_new_context_ldt()
60 int ldt_dup_context(struct mm_struct *oldmm, struct mm_struct *mm);
61 void destroy_context_ldt(struct mm_struct *mm);
62 void ldt_arch_exit_mmap(struct mm_struct *mm);
64 static inline void init_new_context_ldt(struct mm_struct *mm) { } in init_new_context_ldt() argument
66 struct mm_struct *mm) in ldt_dup_context() argument
70 static inline void destroy_context_ldt(struct mm_struct *mm) { } in destroy_context_ldt() argument
71 static inline void ldt_arch_exit_mmap(struct mm_struct *mm) { } in ldt_arch_exit_mmap() argument
75 extern void load_mm_ldt(struct mm_struct *mm);
78 static inline void load_mm_ldt(struct mm_struct *mm) in load_mm_ldt() argument
89 static inline unsigned long mm_lam_cr3_mask(struct mm_struct *mm) in mm_lam_cr3_mask() argument
91 return mm->context.lam_cr3_mask; in mm_lam_cr3_mask()
94 static inline void dup_lam(struct mm_struct *oldmm, struct mm_struct *mm) in dup_lam() argument
96 mm->context.lam_cr3_mask = oldmm->context.lam_cr3_mask; in dup_lam()
97 mm->context.untag_mask = oldmm->context.untag_mask; in dup_lam()
101 static inline unsigned long mm_untag_mask(struct mm_struct *mm) in mm_untag_mask() argument
103 return mm->context.untag_mask; in mm_untag_mask()
106 static inline void mm_reset_untag_mask(struct mm_struct *mm) in mm_reset_untag_mask() argument
108 mm->context.untag_mask = -1UL; in mm_reset_untag_mask()
112 static inline bool arch_pgtable_dma_compat(struct mm_struct *mm) in arch_pgtable_dma_compat() argument
114 return !mm_lam_cr3_mask(mm) || in arch_pgtable_dma_compat()
115 test_bit(MM_CONTEXT_FORCE_TAGGED_SVA, &mm->context.flags); in arch_pgtable_dma_compat()
119 static inline unsigned long mm_lam_cr3_mask(struct mm_struct *mm) in mm_lam_cr3_mask() argument
124 static inline void dup_lam(struct mm_struct *oldmm, struct mm_struct *mm) in dup_lam() argument
128 static inline void mm_reset_untag_mask(struct mm_struct *mm) in mm_reset_untag_mask() argument
134 extern void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
137 * Init a new mm. Used on mm copies, like at fork()
138 * and on mm's that are brand-new, like at execve().
142 struct mm_struct *mm) in init_new_context() argument
144 mutex_init(&mm->context.lock); in init_new_context()
146 mm->context.ctx_id = atomic64_inc_return(&last_mm_ctx_id); in init_new_context()
147 atomic64_set(&mm->context.tlb_gen, 0); in init_new_context()
152 mm->context.pkey_allocation_map = 0x1; in init_new_context()
154 mm->context.execute_only_pkey = -1; in init_new_context()
157 mm_reset_untag_mask(mm); in init_new_context()
158 init_new_context_ldt(mm); in init_new_context()
163 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument
165 destroy_context_ldt(mm); in destroy_context()
182 #define deactivate_mm(tsk, mm) \ argument
187 #define deactivate_mm(tsk, mm) \ argument
196 struct mm_struct *mm) in arch_dup_pkeys() argument
202 /* Duplicate the oldmm pkey state in mm: */ in arch_dup_pkeys()
203 mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map; in arch_dup_pkeys()
204 mm->context.execute_only_pkey = oldmm->context.execute_only_pkey; in arch_dup_pkeys()
208 static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) in arch_dup_mmap() argument
210 arch_dup_pkeys(oldmm, mm); in arch_dup_mmap()
211 paravirt_enter_mmap(mm); in arch_dup_mmap()
212 dup_lam(oldmm, mm); in arch_dup_mmap()
213 return ldt_dup_context(oldmm, mm); in arch_dup_mmap()
216 static inline void arch_exit_mmap(struct mm_struct *mm) in arch_exit_mmap() argument
218 paravirt_arch_exit_mmap(mm); in arch_exit_mmap()
219 ldt_arch_exit_mmap(mm); in arch_exit_mmap()
223 static inline bool is_64bit_mm(struct mm_struct *mm) in is_64bit_mm() argument
226 !test_bit(MM_CONTEXT_UPROBE_IA32, &mm->context.flags); in is_64bit_mm()
229 static inline bool is_64bit_mm(struct mm_struct *mm) in is_64bit_mm() argument
235 static inline void arch_unmap(struct mm_struct *mm, unsigned long start, in arch_unmap() argument
247 * mm, or if we are in a kernel thread.