Lines Matching refs:table

3  *  Page table allocation functions
64 void crst_table_free(struct mm_struct *mm, unsigned long *table)
66 free_pages((unsigned long) table, 2);
169 u64 *table;
173 table = (u64 *)page_to_phys(page);
174 memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
175 memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
188 * page table entry allocation/free routines.
192 unsigned long *table;
196 /* Try to get a fragment of a 4K page as a 2K page table */
198 table = NULL;
206 table = (unsigned long *) page_to_phys(page);
209 table += PTRS_PER_PTE;
216 if (table)
217 return table;
228 /* Initialize page table */
229 table = (unsigned long *) page_to_phys(page);
231 /* Return 4K page table with PGSTEs */
233 memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
234 memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
238 memset64((u64 *)table, _PAGE_INVALID, 2 * PTRS_PER_PTE);
243 return table;
246 void page_table_free(struct mm_struct *mm, unsigned long *table)
251 page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
253 /* Free 2K page table fragment of a 4K page */
254 bit = (__pa(table) & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
275 void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
283 page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
285 gmap_unlink(mm, table, vmaddr);
286 table = (unsigned long *) (__pa(table) | 3);
287 tlb_remove_table(tlb, table);
290 bit = (__pa(table) & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t));
299 table = (unsigned long *) (__pa(table) | (1U << bit));
300 tlb_remove_table(tlb, table);
306 void *table = (void *)((unsigned long) _table ^ mask);
307 struct page *page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
311 free_pages((unsigned long) table, 2);
313 case 1: /* lower 2K of a 4K page table */
314 case 2: /* higher 2K of a 4K page table */
320 case 3: /* 4K page table with pgstes */
338 u64 *table;
340 table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL);
341 if (table)
342 memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
343 return (unsigned long) table;
346 static void base_pgt_free(unsigned long table)
348 kmem_cache_free(base_pgt_cache, (void *) table);
353 unsigned long table;
355 table = __get_free_pages(GFP_KERNEL, CRST_ALLOC_ORDER);
356 if (table)
357 crst_table_init((unsigned long *)table, val);
358 return table;
361 static void base_crst_free(unsigned long table)
363 free_pages(table, CRST_ALLOC_ORDER);
410 unsigned long *ste, next, table;
420 table = base_pgt_alloc();
421 if (!table)
423 *ste = table | _SEGMENT_ENTRY;
425 table = *ste & _SEGMENT_ENTRY_ORIGIN;
426 rc = base_page_walk(table, addr, next, alloc);
430 base_pgt_free(table);
439 unsigned long *rtte, next, table;
449 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY);
450 if (!table)
452 *rtte = table | _REGION3_ENTRY;
454 table = *rtte & _REGION_ENTRY_ORIGIN;
455 rc = base_segment_walk(table, addr, next, alloc);
459 base_crst_free(table);
467 unsigned long *rste, next, table;
477 table = base_crst_alloc(_REGION3_ENTRY_EMPTY);
478 if (!table)
480 *rste = table | _REGION2_ENTRY;
482 table = *rste & _REGION_ENTRY_ORIGIN;
483 rc = base_region3_walk(table, addr, next, alloc);
487 base_crst_free(table);
495 unsigned long *rfte, next, table;
505 table = base_crst_alloc(_REGION2_ENTRY_EMPTY);
506 if (!table)
508 *rfte = table | _REGION1_ENTRY;
510 table = *rfte & _REGION_ENTRY_ORIGIN;
511 rc = base_region2_walk(table, addr, next, alloc);
515 base_crst_free(table);
529 unsigned long table = asce & _ASCE_ORIGIN;
535 base_segment_walk(table, 0, _REGION3_SIZE, 0);
538 base_region3_walk(table, 0, _REGION2_SIZE, 0);
541 base_region2_walk(table, 0, _REGION1_SIZE, 0);
544 base_region1_walk(table, 0, TASK_SIZE_MAX, 0);
547 base_crst_free(table);
581 unsigned long asce, table, end;
588 table = base_crst_alloc(_SEGMENT_ENTRY_EMPTY);
589 if (!table)
591 rc = base_segment_walk(table, addr, end, 1);
592 asce = table | _ASCE_TYPE_SEGMENT | _ASCE_TABLE_LENGTH;
594 table = base_crst_alloc(_REGION3_ENTRY_EMPTY);
595 if (!table)
597 rc = base_region3_walk(table, addr, end, 1);
598 asce = table | _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH;
600 table = base_crst_alloc(_REGION2_ENTRY_EMPTY);
601 if (!table)
603 rc = base_region2_walk(table, addr, end, 1);
604 asce = table | _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH;
606 table = base_crst_alloc(_REGION1_ENTRY_EMPTY);
607 if (!table)
609 rc = base_region1_walk(table, addr, end, 1);
610 asce = table | _ASCE_TYPE_REGION1 | _ASCE_TABLE_LENGTH;