Lines Matching refs:table
64 void crst_table_free(struct mm_struct *mm, unsigned long *table) in crst_table_free() argument
66 free_pages((unsigned long) table, 2); in crst_table_free()
160 u64 *table; in page_table_alloc_pgste() local
164 table = (u64 *)page_to_virt(page); in page_table_alloc_pgste()
165 memset64(table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc_pgste()
166 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc_pgste()
183 unsigned long *table; in page_table_alloc() local
189 table = NULL; in page_table_alloc()
197 table = (unsigned long *) page_to_virt(page); in page_table_alloc()
200 table += PTRS_PER_PTE; in page_table_alloc()
207 if (table) in page_table_alloc()
208 return table; in page_table_alloc()
220 table = (unsigned long *) page_to_virt(page); in page_table_alloc()
224 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); in page_table_alloc()
225 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE); in page_table_alloc()
229 memset64((u64 *)table, _PAGE_INVALID, 2 * PTRS_PER_PTE); in page_table_alloc()
234 return table; in page_table_alloc()
237 void page_table_free(struct mm_struct *mm, unsigned long *table) in page_table_free() argument
242 page = virt_to_page(table); in page_table_free()
245 bit = ((unsigned long) table & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t)); in page_table_free()
264 void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table, in page_table_free_rcu() argument
272 page = virt_to_page(table); in page_table_free_rcu()
274 gmap_unlink(mm, table, vmaddr); in page_table_free_rcu()
275 table = (unsigned long *) ((unsigned long)table | 3); in page_table_free_rcu()
276 tlb_remove_table(tlb, table); in page_table_free_rcu()
279 bit = ((unsigned long) table & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t)); in page_table_free_rcu()
288 table = (unsigned long *) ((unsigned long) table | (1U << bit)); in page_table_free_rcu()
289 tlb_remove_table(tlb, table); in page_table_free_rcu()
295 void *table = (void *)((unsigned long) _table ^ mask); in __tlb_remove_table() local
296 struct page *page = virt_to_page(table); in __tlb_remove_table()
300 free_pages((unsigned long) table, 2); in __tlb_remove_table()
327 u64 *table; in base_pgt_alloc() local
329 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL); in base_pgt_alloc()
330 if (table) in base_pgt_alloc()
331 memset64(table, _PAGE_INVALID, PTRS_PER_PTE); in base_pgt_alloc()
332 return (unsigned long) table; in base_pgt_alloc()
335 static void base_pgt_free(unsigned long table) in base_pgt_free() argument
337 kmem_cache_free(base_pgt_cache, (void *) table); in base_pgt_free()
342 unsigned long table; in base_crst_alloc() local
344 table = __get_free_pages(GFP_KERNEL, CRST_ALLOC_ORDER); in base_crst_alloc()
345 if (table) in base_crst_alloc()
346 crst_table_init((unsigned long *)table, val); in base_crst_alloc()
347 return table; in base_crst_alloc()
350 static void base_crst_free(unsigned long table) in base_crst_free() argument
352 free_pages(table, CRST_ALLOC_ORDER); in base_crst_free()
399 unsigned long *ste, next, table; in base_segment_walk() local
409 table = base_pgt_alloc(); in base_segment_walk()
410 if (!table) in base_segment_walk()
412 *ste = table | _SEGMENT_ENTRY; in base_segment_walk()
414 table = *ste & _SEGMENT_ENTRY_ORIGIN; in base_segment_walk()
415 rc = base_page_walk(table, addr, next, alloc); in base_segment_walk()
419 base_pgt_free(table); in base_segment_walk()
428 unsigned long *rtte, next, table; in base_region3_walk() local
438 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_region3_walk()
439 if (!table) in base_region3_walk()
441 *rtte = table | _REGION3_ENTRY; in base_region3_walk()
443 table = *rtte & _REGION_ENTRY_ORIGIN; in base_region3_walk()
444 rc = base_segment_walk(table, addr, next, alloc); in base_region3_walk()
448 base_crst_free(table); in base_region3_walk()
456 unsigned long *rste, next, table; in base_region2_walk() local
466 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_region2_walk()
467 if (!table) in base_region2_walk()
469 *rste = table | _REGION2_ENTRY; in base_region2_walk()
471 table = *rste & _REGION_ENTRY_ORIGIN; in base_region2_walk()
472 rc = base_region3_walk(table, addr, next, alloc); in base_region2_walk()
476 base_crst_free(table); in base_region2_walk()
484 unsigned long *rfte, next, table; in base_region1_walk() local
494 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_region1_walk()
495 if (!table) in base_region1_walk()
497 *rfte = table | _REGION1_ENTRY; in base_region1_walk()
499 table = *rfte & _REGION_ENTRY_ORIGIN; in base_region1_walk()
500 rc = base_region2_walk(table, addr, next, alloc); in base_region1_walk()
504 base_crst_free(table); in base_region1_walk()
518 unsigned long table = asce & _ASCE_ORIGIN; in base_asce_free() local
524 base_segment_walk(table, 0, _REGION3_SIZE, 0); in base_asce_free()
527 base_region3_walk(table, 0, _REGION2_SIZE, 0); in base_asce_free()
530 base_region2_walk(table, 0, _REGION1_SIZE, 0); in base_asce_free()
533 base_region1_walk(table, 0, TASK_SIZE_MAX, 0); in base_asce_free()
536 base_crst_free(table); in base_asce_free()
570 unsigned long asce, table, end; in base_asce_alloc() local
577 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY); in base_asce_alloc()
578 if (!table) in base_asce_alloc()
580 rc = base_segment_walk(table, addr, end, 1); in base_asce_alloc()
581 asce = table | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH; in base_asce_alloc()
583 table = base_crst_alloc(_REGION3_ENTRY_EMPTY); in base_asce_alloc()
584 if (!table) in base_asce_alloc()
586 rc = base_region3_walk(table, addr, end, 1); in base_asce_alloc()
587 asce = table | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
589 table = base_crst_alloc(_REGION2_ENTRY_EMPTY); in base_asce_alloc()
590 if (!table) in base_asce_alloc()
592 rc = base_region2_walk(table, addr, end, 1); in base_asce_alloc()
593 asce = table | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH; in base_asce_alloc()
595 table = base_crst_alloc(_REGION1_ENTRY_EMPTY); in base_asce_alloc()
596 if (!table) in base_asce_alloc()
598 rc = base_region1_walk(table, addr, end, 1); in base_asce_alloc()
599 asce = table | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH; in base_asce_alloc()