Lines Matching refs:table
3 * Page table allocation functions
54 void crst_table_free(struct mm_struct *mm, unsigned long *table)
56 pagetable_free(virt_to_ptdesc(table));
144 u64 *table;
148 table = (u64 *)ptdesc_to_virt(ptdesc);
149 arch_set_page_dat(virt_to_page(table), 0);
150 memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
151 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
245 unsigned long *table;
249 /* Try to get a fragment of a 4K page as a 2K page table */
251 table = NULL;
268 table = (unsigned long *) ptdesc_to_virt(ptdesc);
271 table += PTRS_PER_PTE;
278 if (table)
279 return table;
290 /* Initialize page table */
291 table = (unsigned long *) ptdesc_to_virt(ptdesc);
293 /* Return 4K page table with PGSTEs */
296 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
297 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
301 memset64((u64 *)table, _PAGE_INVALID, 2 * PTRS_PER_PTE);
306 return table;
309 static void page_table_release_check(struct page *page, void *table,
320 table, half, mask);
333 void page_table_free(struct mm_struct *mm, unsigned long *table)
336 struct ptdesc *ptdesc = virt_to_ptdesc(table);
339 /* Free 2K page table fragment of a 4K page */
340 bit = ((unsigned long) table & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
372 page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
379 void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
384 struct ptdesc *ptdesc = virt_to_ptdesc(table);
388 gmap_unlink(mm, table, vmaddr);
389 table = (unsigned long *) ((unsigned long)table | 0x03U);
390 tlb_remove_ptdesc(tlb, table);
393 bit = ((unsigned long) table & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t));
415 table = (unsigned long *) ((unsigned long) table | (0x01U << bit));
416 tlb_remove_table(tlb, table);
422 void *table = (void *)((unsigned long) _table ^ mask);
423 struct ptdesc *ptdesc = virt_to_ptdesc(table);
429 case 0x01U: /* lower 2K of a 4K page table */
430 case 0x02U: /* higher 2K of a 4K page table */
436 case 0x03U: /* 4K page table with pgstes */
442 page_table_release_check(ptdesc_page(ptdesc), table, half, mask);
474 unsigned long *table;
476 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL);
477 if (table)
478 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
479 return table;
482 static void base_pgt_free(unsigned long *table)
484 kmem_cache_free(base_pgt_cache, table);
489 unsigned long *table;
495 table = ptdesc_address(ptdesc);
497 crst_table_init(table, val);
498 return table;
501 static void base_crst_free(unsigned long *table)
503 pagetable_free(virt_to_ptdesc(table));
550 unsigned long *ste, next, *table;
560 table = base_pgt_alloc();
561 if (!table)
563 *ste = __pa(table) | _SEGMENT_ENTRY;
565 table = __va(*ste & _SEGMENT_ENTRY_ORIGIN);
566 rc = base_page_walk(table, addr, next, alloc);
570 base_pgt_free(table);
579 unsigned long *rtte, next, *table;
589 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY);
590 if (!table)
592 *rtte = __pa(table) | _REGION3_ENTRY;
594 table = __va(*rtte & _REGION_ENTRY_ORIGIN);
595 rc = base_segment_walk(table, addr, next, alloc);
599 base_crst_free(table);
607 unsigned long *rste, next, *table;
617 table = base_crst_alloc(_REGION3_ENTRY_EMPTY);
618 if (!table)
620 *rste = __pa(table) | _REGION2_ENTRY;
622 table = __va(*rste & _REGION_ENTRY_ORIGIN);
623 rc = base_region3_walk(table, addr, next, alloc);
627 base_crst_free(table);
635 unsigned long *rfte, next, *table;
645 table = base_crst_alloc(_REGION2_ENTRY_EMPTY);
646 if (!table)
648 *rfte = __pa(table) | _REGION1_ENTRY;
650 table = __va(*rfte & _REGION_ENTRY_ORIGIN);
651 rc = base_region2_walk(table, addr, next, alloc);
655 base_crst_free(table);
669 unsigned long *table = __va(asce & _ASCE_ORIGIN);
675 base_segment_walk(table, 0, _REGION3_SIZE, 0);
678 base_region3_walk(table, 0, _REGION2_SIZE, 0);
681 base_region2_walk(table, 0, _REGION1_SIZE, 0);
684 base_region1_walk(table, 0, TASK_SIZE_MAX, 0);
687 base_crst_free(table);
721 unsigned long asce, *table, end;
728 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY);
729 if (!table)
731 rc = base_segment_walk(table, addr, end, 1);
732 asce = __pa(table) | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH;
734 table = base_crst_alloc(_REGION3_ENTRY_EMPTY);
735 if (!table)
737 rc = base_region3_walk(table, addr, end, 1);
738 asce = __pa(table) | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH;
740 table = base_crst_alloc(_REGION2_ENTRY_EMPTY);
741 if (!table)
743 rc = base_region2_walk(table, addr, end, 1);
744 asce = __pa(table) | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH;
746 table = base_crst_alloc(_REGION1_ENTRY_EMPTY);
747 if (!table)
749 rc = base_region1_walk(table, addr, end, 1);
750 asce = __pa(table) | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH;