Lines Matching full:mm

13 #include <linux/mm.h>
95 static int hash__init_new_context(struct mm_struct *mm) in hash__init_new_context() argument
99 mm->context.hash_context = kmalloc(sizeof(struct hash_mm_context), in hash__init_new_context()
101 if (!mm->context.hash_context) in hash__init_new_context()
111 * initialize context slice details for newly allocated mm's (which will in hash__init_new_context()
118 if (mm->context.id == 0) { in hash__init_new_context()
119 memset(mm->context.hash_context, 0, sizeof(struct hash_mm_context)); in hash__init_new_context()
120 slice_init_new_context_exec(mm); in hash__init_new_context()
122 /* This is fork. Copy hash_context details from current->mm */ in hash__init_new_context()
123 …memcpy(mm->context.hash_context, current->mm->context.hash_context, sizeof(struct hash_mm_context)… in hash__init_new_context()
126 if (current->mm->context.hash_context->spt) { in hash__init_new_context()
127 mm->context.hash_context->spt = kmalloc(sizeof(struct subpage_prot_table), in hash__init_new_context()
129 if (!mm->context.hash_context->spt) { in hash__init_new_context()
130 kfree(mm->context.hash_context); in hash__init_new_context()
137 index = realloc_context_ids(&mm->context); in hash__init_new_context()
140 kfree(mm->context.hash_context->spt); in hash__init_new_context()
142 kfree(mm->context.hash_context); in hash__init_new_context()
146 pkey_mm_init(mm); in hash__init_new_context()
157 static inline int hash__init_new_context(struct mm_struct *mm) in hash__init_new_context() argument
164 static int radix__init_new_context(struct mm_struct *mm) in radix__init_new_context() argument
178 process_tb[index].prtb0 = cpu_to_be64(rts_field | __pa(mm->pgd) | RADIX_PGD_INDEX_SIZE); in radix__init_new_context()
189 mm->context.hash_context = NULL; in radix__init_new_context()
195 int init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument
200 index = radix__init_new_context(mm); in init_new_context()
202 index = hash__init_new_context(mm); in init_new_context()
207 mm->context.id = index; in init_new_context()
209 mm->context.pte_frag = NULL; in init_new_context()
210 mm->context.pmd_frag = NULL; in init_new_context()
212 mm_iommu_init(mm); in init_new_context()
214 atomic_set(&mm->context.active_cpus, 0); in init_new_context()
215 atomic_set(&mm->context.copros, 0); in init_new_context()
261 static void destroy_pagetable_cache(struct mm_struct *mm) in destroy_pagetable_cache() argument
265 frag = mm->context.pte_frag; in destroy_pagetable_cache()
269 frag = mm->context.pmd_frag; in destroy_pagetable_cache()
275 void destroy_context(struct mm_struct *mm) in destroy_context() argument
278 WARN_ON_ONCE(!list_empty(&mm->context.iommu_group_mem_list)); in destroy_context()
294 process_tb[mm->context.id].prtb0 = 0; in destroy_context()
296 subpage_prot_free(mm); in destroy_context()
297 destroy_contexts(&mm->context); in destroy_context()
298 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
301 void arch_exit_mmap(struct mm_struct *mm) in arch_exit_mmap() argument
303 destroy_pagetable_cache(mm); in arch_exit_mmap()
320 process_tb[mm->context.id].prtb0 = 0; in arch_exit_mmap()