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 pagetable_free(virt_to_ptdesc(table)); in crst_table_free()
141 u64 *table; in page_table_alloc_pgste() local
145 table = (u64 *)ptdesc_to_virt(ptdesc); in page_table_alloc_pgste()
146 __arch_set_page_dat(table, 1); in page_table_alloc_pgste()
147 memset64(table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc_pgste()
148 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc_pgste()
163 unsigned long *table; in page_table_alloc() local
172 table = ptdesc_to_virt(ptdesc); in page_table_alloc()
173 __arch_set_page_dat(table, 1); in page_table_alloc()
176 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc()
177 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc()
178 return table; in page_table_alloc()
187 void page_table_free(struct mm_struct *mm, unsigned long *table) in page_table_free() argument
189 struct ptdesc *ptdesc = virt_to_ptdesc(table); in page_table_free()
194 void __tlb_remove_table(void *table) in __tlb_remove_table() argument
196 struct ptdesc *ptdesc = virt_to_ptdesc(table); in __tlb_remove_table()
237 unsigned long *table; in base_pgt_alloc() local
239 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL); in base_pgt_alloc()
240 if (table) in base_pgt_alloc()
241 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in base_pgt_alloc()
242 return table; in base_pgt_alloc()
245 static void base_pgt_free(unsigned long *table) in base_pgt_free() argument
247 kmem_cache_free(base_pgt_cache, table); in base_pgt_free()
252 unsigned long *table; in base_crst_alloc() local
258 table = ptdesc_address(ptdesc); in base_crst_alloc()
259 crst_table_init(table, val); in base_crst_alloc()
260 return table; in base_crst_alloc()
263 static void base_crst_free(unsigned long *table) in base_crst_free() argument
265 pagetable_free(virt_to_ptdesc(table)); in base_crst_free()
312 unsigned long *ste, next, *table; in base_segment_walk() local
322 table = base_pgt_alloc(); in base_segment_walk()
323 if (!table) in base_segment_walk()
325 *ste = __pa(table) | _SEGMENT_ENTRY; in base_segment_walk()
327 table = __va(*ste & _SEGMENT_ENTRY_ORIGIN); in base_segment_walk()
328 rc = base_page_walk(table, addr, next, alloc); in base_segment_walk()
332 base_pgt_free(table); in base_segment_walk()
341 unsigned long *rtte, next, *table; in base_region3_walk() local
351 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_region3_walk()
352 if (!table) in base_region3_walk()
354 *rtte = __pa(table) | _REGION3_ENTRY; in base_region3_walk()
356 table = __va(*rtte & _REGION_ENTRY_ORIGIN); in base_region3_walk()
357 rc = base_segment_walk(table, addr, next, alloc); in base_region3_walk()
361 base_crst_free(table); in base_region3_walk()
369 unsigned long *rste, next, *table; in base_region2_walk() local
379 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_region2_walk()
380 if (!table) in base_region2_walk()
382 *rste = __pa(table) | _REGION2_ENTRY; in base_region2_walk()
384 table = __va(*rste & _REGION_ENTRY_ORIGIN); in base_region2_walk()
385 rc = base_region3_walk(table, addr, next, alloc); in base_region2_walk()
389 base_crst_free(table); in base_region2_walk()
397 unsigned long *rfte, next, *table; in base_region1_walk() local
407 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_region1_walk()
408 if (!table) in base_region1_walk()
410 *rfte = __pa(table) | _REGION1_ENTRY; in base_region1_walk()
412 table = __va(*rfte & _REGION_ENTRY_ORIGIN); in base_region1_walk()
413 rc = base_region2_walk(table, addr, next, alloc); in base_region1_walk()
417 base_crst_free(table); in base_region1_walk()
431 unsigned long *table = __va(asce & _ASCE_ORIGIN); in base_asce_free() local
437 base_segment_walk(table, 0, _REGION3_SIZE, 0); in base_asce_free()
440 base_region3_walk(table, 0, _REGION2_SIZE, 0); in base_asce_free()
443 base_region2_walk(table, 0, _REGION1_SIZE, 0); in base_asce_free()
446 base_region1_walk(table, 0, TASK_SIZE_MAX, 0); in base_asce_free()
449 base_crst_free(table); in base_asce_free()
483 unsigned long asce, *table, end; in base_asce_alloc() local
490 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_asce_alloc()
491 if (!table) in base_asce_alloc()
493 rc = base_segment_walk(table, addr, end, 1); in base_asce_alloc()
494 asce = __pa(table) | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH; in base_asce_alloc()
496 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_asce_alloc()
497 if (!table) in base_asce_alloc()
499 rc = base_region3_walk(table, addr, end, 1); in base_asce_alloc()
500 asce = __pa(table) | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
502 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_asce_alloc()
503 if (!table) in base_asce_alloc()
505 rc = base_region2_walk(table, addr, end, 1); in base_asce_alloc()
506 asce = __pa(table) | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
508 table = base_crst_alloc(_REGION1_ENTRY_EMPTY); in base_asce_alloc()
509 if (!table) in base_asce_alloc()
511 rc = base_region1_walk(table, addr, end, 1); in base_asce_alloc()
512 asce = __pa(table) | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH; in base_asce_alloc()