Lines Matching refs:mm
92 static int hash__init_new_context(struct mm_struct *mm) in hash__init_new_context() argument
96 mm->context.hash_context = kmalloc(sizeof(struct hash_mm_context), in hash__init_new_context()
98 if (!mm->context.hash_context) in hash__init_new_context()
115 if (mm->context.id == 0) { in hash__init_new_context()
116 memset(mm->context.hash_context, 0, sizeof(struct hash_mm_context)); in hash__init_new_context()
117 slice_init_new_context_exec(mm); in hash__init_new_context()
120 …memcpy(mm->context.hash_context, current->mm->context.hash_context, sizeof(struct hash_mm_context)… in hash__init_new_context()
123 if (current->mm->context.hash_context->spt) { in hash__init_new_context()
124 mm->context.hash_context->spt = kmalloc(sizeof(struct subpage_prot_table), in hash__init_new_context()
126 if (!mm->context.hash_context->spt) { in hash__init_new_context()
127 kfree(mm->context.hash_context); in hash__init_new_context()
134 index = realloc_context_ids(&mm->context); in hash__init_new_context()
137 kfree(mm->context.hash_context->spt); in hash__init_new_context()
139 kfree(mm->context.hash_context); in hash__init_new_context()
143 pkey_mm_init(mm); in hash__init_new_context()
154 static int radix__init_new_context(struct mm_struct *mm) in radix__init_new_context() argument
168 process_tb[index].prtb0 = cpu_to_be64(rts_field | __pa(mm->pgd) | RADIX_PGD_INDEX_SIZE); in radix__init_new_context()
178 mm->context.hash_context = NULL; in radix__init_new_context()
183 int init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument
188 index = radix__init_new_context(mm); in init_new_context()
190 index = hash__init_new_context(mm); in init_new_context()
195 mm->context.id = index; in init_new_context()
197 mm->context.pte_frag = NULL; in init_new_context()
198 mm->context.pmd_frag = NULL; in init_new_context()
200 mm_iommu_init(mm); in init_new_context()
202 atomic_set(&mm->context.active_cpus, 0); in init_new_context()
203 atomic_set(&mm->context.copros, 0); in init_new_context()
241 static void destroy_pagetable_cache(struct mm_struct *mm) in destroy_pagetable_cache() argument
245 frag = mm->context.pte_frag; in destroy_pagetable_cache()
249 frag = mm->context.pmd_frag; in destroy_pagetable_cache()
255 void destroy_context(struct mm_struct *mm) in destroy_context() argument
258 WARN_ON_ONCE(!list_empty(&mm->context.iommu_group_mem_list)); in destroy_context()
274 process_tb[mm->context.id].prtb0 = 0; in destroy_context()
276 subpage_prot_free(mm); in destroy_context()
277 destroy_contexts(&mm->context); in destroy_context()
278 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
281 void arch_exit_mmap(struct mm_struct *mm) in arch_exit_mmap() argument
283 destroy_pagetable_cache(mm); in arch_exit_mmap()
300 process_tb[mm->context.id].prtb0 = 0; in arch_exit_mmap()