diff options
-rw-r--r-- | arch/x86/mm/init_64.c | 16 | ||||
-rw-r--r-- | include/asm-x86/pgalloc_64.h | 33 |
2 files changed, 34 insertions, 15 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 1ff7906a9a4d..2d89b7abbc54 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -662,6 +662,22 @@ int memory_add_physaddr_to_nid(u64 start) | |||
662 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | 662 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); |
663 | #endif | 663 | #endif |
664 | 664 | ||
665 | void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) | ||
666 | { | ||
667 | pgtable_page_dtor(pte); | ||
668 | tlb_remove_page(tlb, pte); | ||
669 | } | ||
670 | |||
671 | void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | ||
672 | { | ||
673 | tlb_remove_page(tlb, virt_to_page(pmd)); | ||
674 | } | ||
675 | |||
676 | void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) | ||
677 | { | ||
678 | tlb_remove_page(tlb, virt_to_page(pud)); | ||
679 | } | ||
680 | |||
665 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 681 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
666 | 682 | ||
667 | static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, | 683 | static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, |
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h index 8d6722320dcc..bcf525f3fbd0 100644 --- a/include/asm-x86/pgalloc_64.h +++ b/include/asm-x86/pgalloc_64.h | |||
@@ -1,16 +1,24 @@ | |||
1 | #ifndef _X86_64_PGALLOC_H | 1 | #ifndef _X86_64_PGALLOC_H |
2 | #define _X86_64_PGALLOC_H | 2 | #define _X86_64_PGALLOC_H |
3 | 3 | ||
4 | #include <asm/pda.h> | ||
5 | #include <linux/threads.h> | 4 | #include <linux/threads.h> |
6 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include <asm/pda.h> | ||
7 | 7 | ||
8 | #define pmd_populate_kernel(mm, pmd, pte) \ | 8 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
9 | set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) | 9 | { |
10 | #define pud_populate(mm, pud, pmd) \ | 10 | set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))); |
11 | set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd))) | 11 | } |
12 | #define pgd_populate(mm, pgd, pud) \ | 12 | |
13 | set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))) | 13 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) |
14 | { | ||
15 | set_pud(pud, __pud(_PAGE_TABLE | __pa(pmd))); | ||
16 | } | ||
17 | |||
18 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | ||
19 | { | ||
20 | set_pgd(pgd, __pgd(_PAGE_TABLE | __pa(pud))); | ||
21 | } | ||
14 | 22 | ||
15 | #define pmd_pgtable(pmd) pmd_page(pmd) | 23 | #define pmd_pgtable(pmd) pmd_page(pmd) |
16 | 24 | ||
@@ -121,13 +129,8 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | |||
121 | __free_page(pte); | 129 | __free_page(pte); |
122 | } | 130 | } |
123 | 131 | ||
124 | #define __pte_free_tlb(tlb,pte) \ | 132 | extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte); |
125 | do { \ | 133 | extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); |
126 | pgtable_page_dtor((pte)); \ | 134 | extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud); |
127 | tlb_remove_page((tlb), (pte)); \ | ||
128 | } while (0) | ||
129 | |||
130 | #define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) | ||
131 | #define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) | ||
132 | 135 | ||
133 | #endif /* _X86_64_PGALLOC_H */ | 136 | #endif /* _X86_64_PGALLOC_H */ |