Lines Matching full:table
3 * Page table allocation functions
47 unsigned long *table; in crst_table_alloc() local
51 table = ptdesc_to_virt(ptdesc); in crst_table_alloc()
52 __arch_set_page_dat(table, 1UL << CRST_ALLOC_ORDER); in crst_table_alloc()
53 return table; in crst_table_alloc()
56 void crst_table_free(struct mm_struct *mm, unsigned long *table) in crst_table_free() argument
58 if (!table) in crst_table_free()
60 pagetable_free(virt_to_ptdesc(table)); in crst_table_free()
146 u64 *table; in page_table_alloc_pgste() local
150 table = (u64 *)ptdesc_to_virt(ptdesc); in page_table_alloc_pgste()
151 __arch_set_page_dat(table, 1); in page_table_alloc_pgste()
152 memset64(table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc_pgste()
153 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc_pgste()
168 unsigned long *table; in page_table_alloc() local
177 table = ptdesc_to_virt(ptdesc); in page_table_alloc()
178 __arch_set_page_dat(table, 1); in page_table_alloc()
179 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc()
180 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc()
181 return table; in page_table_alloc()
184 void page_table_free(struct mm_struct *mm, unsigned long *table) in page_table_free() argument
186 struct ptdesc *ptdesc = virt_to_ptdesc(table); in page_table_free()
221 unsigned long *table; in base_pgt_alloc() local
223 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL); in base_pgt_alloc()
224 if (table) in base_pgt_alloc()
225 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in base_pgt_alloc()
226 return table; in base_pgt_alloc()
229 static void base_pgt_free(unsigned long *table) in base_pgt_free() argument
231 kmem_cache_free(base_pgt_cache, table); in base_pgt_free()
236 unsigned long *table; in base_crst_alloc() local
242 table = ptdesc_address(ptdesc); in base_crst_alloc()
243 crst_table_init(table, val); in base_crst_alloc()
244 return table; in base_crst_alloc()
247 static void base_crst_free(unsigned long *table) in base_crst_free() argument
249 if (!table) in base_crst_free()
251 pagetable_free(virt_to_ptdesc(table)); in base_crst_free()
298 unsigned long *ste, next, *table; in base_segment_walk() local
308 table = base_pgt_alloc(); in base_segment_walk()
309 if (!table) in base_segment_walk()
311 *ste = __pa(table) | _SEGMENT_ENTRY; in base_segment_walk()
313 table = __va(*ste & _SEGMENT_ENTRY_ORIGIN); in base_segment_walk()
314 rc = base_page_walk(table, addr, next, alloc); in base_segment_walk()
318 base_pgt_free(table); in base_segment_walk()
327 unsigned long *rtte, next, *table; in base_region3_walk() local
337 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_region3_walk()
338 if (!table) in base_region3_walk()
340 *rtte = __pa(table) | _REGION3_ENTRY; in base_region3_walk()
342 table = __va(*rtte & _REGION_ENTRY_ORIGIN); in base_region3_walk()
343 rc = base_segment_walk(table, addr, next, alloc); in base_region3_walk()
347 base_crst_free(table); in base_region3_walk()
355 unsigned long *rste, next, *table; in base_region2_walk() local
365 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_region2_walk()
366 if (!table) in base_region2_walk()
368 *rste = __pa(table) | _REGION2_ENTRY; in base_region2_walk()
370 table = __va(*rste & _REGION_ENTRY_ORIGIN); in base_region2_walk()
371 rc = base_region3_walk(table, addr, next, alloc); in base_region2_walk()
375 base_crst_free(table); in base_region2_walk()
383 unsigned long *rfte, next, *table; in base_region1_walk() local
393 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_region1_walk()
394 if (!table) in base_region1_walk()
396 *rfte = __pa(table) | _REGION1_ENTRY; in base_region1_walk()
398 table = __va(*rfte & _REGION_ENTRY_ORIGIN); in base_region1_walk()
399 rc = base_region2_walk(table, addr, next, alloc); in base_region1_walk()
403 base_crst_free(table); in base_region1_walk()
417 unsigned long *table = __va(asce & _ASCE_ORIGIN); in base_asce_free() local
423 base_segment_walk(table, 0, _REGION3_SIZE, 0); in base_asce_free()
426 base_region3_walk(table, 0, _REGION2_SIZE, 0); in base_asce_free()
429 base_region2_walk(table, 0, _REGION1_SIZE, 0); in base_asce_free()
432 base_region1_walk(table, 0, TASK_SIZE_MAX, 0); in base_asce_free()
435 base_crst_free(table); in base_asce_free()
469 unsigned long asce, *table, end; in base_asce_alloc() local
476 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_asce_alloc()
477 if (!table) in base_asce_alloc()
479 rc = base_segment_walk(table, addr, end, 1); in base_asce_alloc()
480 asce = __pa(table) | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH; in base_asce_alloc()
482 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_asce_alloc()
483 if (!table) in base_asce_alloc()
485 rc = base_region3_walk(table, addr, end, 1); in base_asce_alloc()
486 asce = __pa(table) | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
488 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_asce_alloc()
489 if (!table) in base_asce_alloc()
491 rc = base_region2_walk(table, addr, end, 1); in base_asce_alloc()
492 asce = __pa(table) | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
494 table = base_crst_alloc(_REGION1_ENTRY_EMPTY); in base_asce_alloc()
495 if (!table) in base_asce_alloc()
497 rc = base_region1_walk(table, addr, end, 1); in base_asce_alloc()
498 asce = __pa(table) | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH; in base_asce_alloc()