3 #include <asm/pgalloc.h>
4 #include <asm/pgtable.h>
6 #include <asm/fixmap.h>
8 #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
11 #define PGALLOC_USER_GFP __GFP_HIGHMEM
13 #define PGALLOC_USER_GFP 0
29 pgtable_page_ctor(pte);
33 static int __init setup_userpte(
char *
arg)
42 if (
strcmp(arg,
"nohigh") == 0)
52 pgtable_page_dtor(pte);
54 tlb_remove_page(tlb, pte);
57 #if PAGETABLE_LEVELS > 2
64 #if PAGETABLE_LEVELS > 3
73 static inline void pgd_list_add(
pgd_t *pgd)
80 static inline void pgd_list_del(
pgd_t *pgd)
87 #define UNSHARED_PTRS_PER_PGD \
88 (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
127 spin_lock(&pgd_lock);
129 spin_unlock(&pgd_lock);
143 #ifdef CONFIG_X86_PAE
155 #define PREALLOCATED_PMDS UNSHARED_PTRS_PER_PGD
176 #define PREALLOCATED_PMDS 0
180 static void free_pmds(
pmd_t *pmds[])
189 static int preallocate_pmds(
pmd_t *pmds[])
225 pgdp[
i] = native_make_pgd(0);
239 if (PREALLOCATED_PMDS == 0)
268 if (preallocate_pmds(pmds) != 0)
282 pgd_prepopulate_pmd(mm, pgd, pmds);
298 pgd_mop_up_pmds(mm, pgd);
300 paravirt_pgd_free(mm, pgd);
310 if (changed && dirty) {
319 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
324 int changed = !pmd_same(*pmdp, entry);
328 if (changed && dirty) {
339 unsigned long addr,
pte_t *ptep)
345 (
unsigned long *) &ptep->
pte);
353 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
355 unsigned long addr,
pmd_t *pmdp)
361 (
unsigned long *)pmdp);
371 unsigned long address,
pte_t *ptep)
382 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
384 unsigned long address,
pmd_t *pmdp)
398 unsigned long address,
pmd_t *pmdp)
403 (
unsigned long *)pmdp);