Lines Matching full:table

3  *  Page table allocation functions
22 unsigned long *table; in crst_table_alloc() local
26 table = ptdesc_to_virt(ptdesc); in crst_table_alloc()
27 __arch_set_page_dat(table, 1UL << CRST_ALLOC_ORDER); in crst_table_alloc()
28 return table; in crst_table_alloc()
31 void crst_table_free(struct mm_struct *mm, unsigned long *table) in crst_table_free() argument
33 if (!table) in crst_table_free()
35 pagetable_free(virt_to_ptdesc(table)); in crst_table_free()
121 u64 *table; in page_table_alloc_pgste() local
125 table = (u64 *)ptdesc_to_virt(ptdesc); in page_table_alloc_pgste()
126 __arch_set_page_dat(table, 1); in page_table_alloc_pgste()
127 memset64(table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc_pgste()
128 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc_pgste()
143 unsigned long *table; in page_table_alloc() local
152 table = ptdesc_to_virt(ptdesc); in page_table_alloc()
153 __arch_set_page_dat(table, 1); in page_table_alloc()
154 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc()
155 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc()
156 return table; in page_table_alloc()
159 void page_table_free(struct mm_struct *mm, unsigned long *table) in page_table_free() argument
161 struct ptdesc *ptdesc = virt_to_ptdesc(table); in page_table_free()
196 unsigned long *table; in base_pgt_alloc() local
198 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL); in base_pgt_alloc()
199 if (table) in base_pgt_alloc()
200 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in base_pgt_alloc()
201 return table; in base_pgt_alloc()
204 static void base_pgt_free(unsigned long *table) in base_pgt_free() argument
206 kmem_cache_free(base_pgt_cache, table); in base_pgt_free()
211 unsigned long *table; in base_crst_alloc() local
217 table = ptdesc_address(ptdesc); in base_crst_alloc()
218 crst_table_init(table, val); in base_crst_alloc()
219 return table; in base_crst_alloc()
222 static void base_crst_free(unsigned long *table) in base_crst_free() argument
224 if (!table) in base_crst_free()
226 pagetable_free(virt_to_ptdesc(table)); in base_crst_free()
273 unsigned long *ste, next, *table; in base_segment_walk() local
283 table = base_pgt_alloc(); in base_segment_walk()
284 if (!table) in base_segment_walk()
286 *ste = __pa(table) | _SEGMENT_ENTRY; in base_segment_walk()
288 table = __va(*ste & _SEGMENT_ENTRY_ORIGIN); in base_segment_walk()
289 rc = base_page_walk(table, addr, next, alloc); in base_segment_walk()
293 base_pgt_free(table); in base_segment_walk()
302 unsigned long *rtte, next, *table; in base_region3_walk() local
312 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_region3_walk()
313 if (!table) in base_region3_walk()
315 *rtte = __pa(table) | _REGION3_ENTRY; in base_region3_walk()
317 table = __va(*rtte & _REGION_ENTRY_ORIGIN); in base_region3_walk()
318 rc = base_segment_walk(table, addr, next, alloc); in base_region3_walk()
322 base_crst_free(table); in base_region3_walk()
330 unsigned long *rste, next, *table; in base_region2_walk() local
340 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_region2_walk()
341 if (!table) in base_region2_walk()
343 *rste = __pa(table) | _REGION2_ENTRY; in base_region2_walk()
345 table = __va(*rste & _REGION_ENTRY_ORIGIN); in base_region2_walk()
346 rc = base_region3_walk(table, addr, next, alloc); in base_region2_walk()
350 base_crst_free(table); in base_region2_walk()
358 unsigned long *rfte, next, *table; in base_region1_walk() local
368 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_region1_walk()
369 if (!table) in base_region1_walk()
371 *rfte = __pa(table) | _REGION1_ENTRY; in base_region1_walk()
373 table = __va(*rfte & _REGION_ENTRY_ORIGIN); in base_region1_walk()
374 rc = base_region2_walk(table, addr, next, alloc); in base_region1_walk()
378 base_crst_free(table); in base_region1_walk()
392 unsigned long *table = __va(asce & _ASCE_ORIGIN); in base_asce_free() local
398 base_segment_walk(table, 0, _REGION3_SIZE, 0); in base_asce_free()
401 base_region3_walk(table, 0, _REGION2_SIZE, 0); in base_asce_free()
404 base_region2_walk(table, 0, _REGION1_SIZE, 0); in base_asce_free()
407 base_region1_walk(table, 0, TASK_SIZE_MAX, 0); in base_asce_free()
410 base_crst_free(table); in base_asce_free()
444 unsigned long asce, *table, end; in base_asce_alloc() local
451 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_asce_alloc()
452 if (!table) in base_asce_alloc()
454 rc = base_segment_walk(table, addr, end, 1); in base_asce_alloc()
455 asce = __pa(table) | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH; in base_asce_alloc()
457 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_asce_alloc()
458 if (!table) in base_asce_alloc()
460 rc = base_region3_walk(table, addr, end, 1); in base_asce_alloc()
461 asce = __pa(table) | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
463 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_asce_alloc()
464 if (!table) in base_asce_alloc()
466 rc = base_region2_walk(table, addr, end, 1); in base_asce_alloc()
467 asce = __pa(table) | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
469 table = base_crst_alloc(_REGION1_ENTRY_EMPTY); in base_asce_alloc()
470 if (!table) in base_asce_alloc()
472 rc = base_region1_walk(table, addr, end, 1); in base_asce_alloc()
473 asce = __pa(table) | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH; in base_asce_alloc()