diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2015-04-14 18:46:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:49:02 -0400 |
commit | 982333683385343d8d2db9a1df69c98406f42687 (patch) | |
tree | 2ce273cf325bcad64d032090344778fb0267f59a /arch/x86/mm | |
parent | 6b8ce2a1a464526335672c33cbf3cb9fc638efff (diff) |
x86: expose number of page table levels on Kconfig level
We would want to use number of page table level to define mm_struct.
Let's expose it as CONFIG_PGTABLE_LEVELS.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/pgtable.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 5a7e5252c878..b28edfecbdfe 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -58,7 +58,7 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte) | |||
58 | tlb_remove_page(tlb, pte); | 58 | tlb_remove_page(tlb, pte); |
59 | } | 59 | } |
60 | 60 | ||
61 | #if PAGETABLE_LEVELS > 2 | 61 | #if CONFIG_PGTABLE_LEVELS > 2 |
62 | void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | 62 | void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) |
63 | { | 63 | { |
64 | struct page *page = virt_to_page(pmd); | 64 | struct page *page = virt_to_page(pmd); |
@@ -74,14 +74,14 @@ void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
74 | tlb_remove_page(tlb, page); | 74 | tlb_remove_page(tlb, page); |
75 | } | 75 | } |
76 | 76 | ||
77 | #if PAGETABLE_LEVELS > 3 | 77 | #if CONFIG_PGTABLE_LEVELS > 3 |
78 | void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) | 78 | void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) |
79 | { | 79 | { |
80 | paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); | 80 | paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); |
81 | tlb_remove_page(tlb, virt_to_page(pud)); | 81 | tlb_remove_page(tlb, virt_to_page(pud)); |
82 | } | 82 | } |
83 | #endif /* PAGETABLE_LEVELS > 3 */ | 83 | #endif /* CONFIG_PGTABLE_LEVELS > 3 */ |
84 | #endif /* PAGETABLE_LEVELS > 2 */ | 84 | #endif /* CONFIG_PGTABLE_LEVELS > 2 */ |
85 | 85 | ||
86 | static inline void pgd_list_add(pgd_t *pgd) | 86 | static inline void pgd_list_add(pgd_t *pgd) |
87 | { | 87 | { |
@@ -117,9 +117,9 @@ static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd) | |||
117 | /* If the pgd points to a shared pagetable level (either the | 117 | /* If the pgd points to a shared pagetable level (either the |
118 | ptes in non-PAE, or shared PMD in PAE), then just copy the | 118 | ptes in non-PAE, or shared PMD in PAE), then just copy the |
119 | references from swapper_pg_dir. */ | 119 | references from swapper_pg_dir. */ |
120 | if (PAGETABLE_LEVELS == 2 || | 120 | if (CONFIG_PGTABLE_LEVELS == 2 || |
121 | (PAGETABLE_LEVELS == 3 && SHARED_KERNEL_PMD) || | 121 | (CONFIG_PGTABLE_LEVELS == 3 && SHARED_KERNEL_PMD) || |
122 | PAGETABLE_LEVELS == 4) { | 122 | CONFIG_PGTABLE_LEVELS == 4) { |
123 | clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY, | 123 | clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY, |
124 | swapper_pg_dir + KERNEL_PGD_BOUNDARY, | 124 | swapper_pg_dir + KERNEL_PGD_BOUNDARY, |
125 | KERNEL_PGD_PTRS); | 125 | KERNEL_PGD_PTRS); |