Lines Matching refs:pgd
93 static inline void pgd_list_add(pgd_t *pgd) in pgd_list_add() argument
95 struct page *page = virt_to_page(pgd); in pgd_list_add()
100 static inline void pgd_list_del(pgd_t *pgd) in pgd_list_del() argument
102 struct page *page = virt_to_page(pgd); in pgd_list_del()
113 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) in pgd_set_mm() argument
115 virt_to_page(pgd)->pt_mm = mm; in pgd_set_mm()
123 static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd) in pgd_ctor() argument
131 clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY, in pgd_ctor()
138 pgd_set_mm(pgd, mm); in pgd_ctor()
139 pgd_list_add(pgd); in pgd_ctor()
143 static void pgd_dtor(pgd_t *pgd) in pgd_dtor() argument
149 pgd_list_del(pgd); in pgd_dtor()
264 pgd_t pgd = *pgdp; in mop_up_one_pmd() local
266 if (pgd_val(pgd) != 0) { in mop_up_one_pmd()
267 pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd); in mop_up_one_pmd()
271 paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT); in mop_up_one_pmd()
296 static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[]) in pgd_prepopulate_pmd() argument
305 p4d = p4d_offset(pgd, 0); in pgd_prepopulate_pmd()
403 static inline void _pgd_free(pgd_t *pgd) in _pgd_free() argument
406 free_pages((unsigned long)pgd, PGD_ALLOCATION_ORDER); in _pgd_free()
408 kmem_cache_free(pgd_cache, pgd); in _pgd_free()
418 static inline void _pgd_free(pgd_t *pgd) in _pgd_free() argument
420 free_pages((unsigned long)pgd, PGD_ALLOCATION_ORDER); in _pgd_free()
426 pgd_t *pgd; in pgd_alloc() local
430 pgd = _pgd_alloc(); in pgd_alloc()
432 if (pgd == NULL) in pgd_alloc()
435 mm->pgd = pgd; in pgd_alloc()
453 pgd_ctor(mm, pgd); in pgd_alloc()
454 pgd_prepopulate_pmd(mm, pgd, pmds); in pgd_alloc()
455 pgd_prepopulate_user_pmd(mm, pgd, u_pmds); in pgd_alloc()
459 return pgd; in pgd_alloc()
466 _pgd_free(pgd); in pgd_alloc()
471 void pgd_free(struct mm_struct *mm, pgd_t *pgd) in pgd_free() argument
473 pgd_mop_up_pmds(mm, pgd); in pgd_free()
474 pgd_dtor(pgd); in pgd_free()
475 paravirt_pgd_free(mm, pgd); in pgd_free()
476 _pgd_free(pgd); in pgd_free()