Lines Matching refs:pgd
93 static inline void pgd_list_add(pgd_t *pgd)
95 struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
100 static inline void pgd_list_del(pgd_t *pgd)
102 struct ptdesc *ptdesc = virt_to_ptdesc(pgd);
113 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
115 virt_to_ptdesc(pgd)->pt_mm = mm;
123 static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
125 /* If the pgd points to a shared pagetable level (either the
131 clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY,
138 pgd_set_mm(pgd, mm);
139 pgd_list_add(pgd);
143 static void pgd_dtor(pgd_t *pgd)
149 pgd_list_del(pgd);
154 * List of all pgd's needed for non-PAE so it can invalidate entries
155 * in both cached and uncached pgd's; not needed for PAE since the
200 * TLB via cr3 if the top-level pgd is changed...
266 * Mop up any pmd pages which may still be attached to the pgd.
273 pgd_t pgd = *pgdp;
275 if (pgd_val(pgd) != 0) {
276 pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd);
280 paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT);
305 static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
311 p4d = p4d_offset(pgd, 0);
358 * Xen paravirt assumes pgd table should be in one page. 64 bit kernel also
359 * assumes that pgd should be in one page.
362 * only needs to allocate 32 bytes for pgd instead of one page.
377 * shared kernel pmd. And this requires a whole page for pgd.
385 * page for pgd. We are able to just allocate a 32-byte for pgd.
386 * During boot time, we create a 32-byte slab for pgd table allocation.
396 * We allocate one page for pgd.
404 * a 32-byte slab for pgd to save memory space.
409 static inline void _pgd_free(pgd_t *pgd)
412 free_pages((unsigned long)pgd, PGD_ALLOCATION_ORDER);
414 kmem_cache_free(pgd_cache, pgd);
424 static inline void _pgd_free(pgd_t *pgd)
426 free_pages((unsigned long)pgd, PGD_ALLOCATION_ORDER);
432 pgd_t *pgd;
436 pgd = _pgd_alloc();
438 if (pgd == NULL)
441 mm->pgd = pgd;
457 * never see a partially populated pgd.
461 pgd_ctor(mm, pgd);
463 pgd_prepopulate_pmd(mm, pgd, pmds);
466 pgd_prepopulate_user_pmd(mm, pgd, u_pmds);
470 return pgd;
479 _pgd_free(pgd);
484 void pgd_free(struct mm_struct *mm, pgd_t *pgd)
486 pgd_mop_up_pmds(mm, pgd);
487 pgd_dtor(pgd);
488 paravirt_pgd_free(mm, pgd);
489 _pgd_free(pgd);