aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/hugetlbpage.c3
-rw-r--r--arch/x86/mm/init_32.c1
-rw-r--r--include/asm-generic/tlb.h1
-rw-r--r--include/asm-x86/pgalloc_32.h61
-rw-r--r--include/asm-x86/pgtable-3level.h2
-rw-r--r--include/linux/swap.h1
6 files changed, 43 insertions, 26 deletions
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 6c06d9c0488e..4fbafb4bc2f0 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
15#include <asm/mman.h> 15#include <asm/mman.h>
16#include <asm/tlb.h> 16#include <asm/tlb.h>
17#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
18#include <asm/pgalloc.h>
18 19
19static unsigned long page_table_shareable(struct vm_area_struct *svma, 20static unsigned long page_table_shareable(struct vm_area_struct *svma,
20 struct vm_area_struct *vma, 21 struct vm_area_struct *vma,
@@ -88,7 +89,7 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
88 89
89 spin_lock(&mm->page_table_lock); 90 spin_lock(&mm->page_table_lock);
90 if (pud_none(*pud)) 91 if (pud_none(*pud))
91 pud_populate(mm, pud, (unsigned long) spte & PAGE_MASK); 92 pud_populate(mm, pud, (pmd_t *)((unsigned long)spte & PAGE_MASK));
92 else 93 else
93 put_page(virt_to_page(spte)); 94 put_page(virt_to_page(spte));
94 spin_unlock(&mm->page_table_lock); 95 spin_unlock(&mm->page_table_lock);
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 98d2acae4f64..459b384acda9 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -41,6 +41,7 @@
41#include <asm/apic.h> 41#include <asm/apic.h>
42#include <asm/tlb.h> 42#include <asm/tlb.h>
43#include <asm/tlbflush.h> 43#include <asm/tlbflush.h>
44#include <asm/pgalloc.h>
44#include <asm/sections.h> 45#include <asm/sections.h>
45#include <asm/paravirt.h> 46#include <asm/paravirt.h>
46 47
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 75f2bfab614f..6ce9f3ab928d 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -15,7 +15,6 @@
15 15
16#include <linux/swap.h> 16#include <linux/swap.h>
17#include <linux/quicklist.h> 17#include <linux/quicklist.h>
18#include <asm/pgalloc.h>
19#include <asm/tlbflush.h> 18#include <asm/tlbflush.h>
20 19
21/* 20/*
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h
index fbc6357f5eba..3482c3427897 100644
--- a/include/asm-x86/pgalloc_32.h
+++ b/include/asm-x86/pgalloc_32.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5#include <linux/mm.h> /* for struct page */ 5#include <linux/mm.h> /* for struct page */
6#include <asm/tlb.h>
7#include <asm-generic/tlb.h>
6 8
7#ifdef CONFIG_PARAVIRT 9#ifdef CONFIG_PARAVIRT
8#include <asm/paravirt.h> 10#include <asm/paravirt.h>
@@ -14,19 +16,20 @@
14#define paravirt_release_pd(pfn) do { } while (0) 16#define paravirt_release_pd(pfn) do { } while (0)
15#endif 17#endif
16 18
17#define pmd_populate_kernel(mm, pmd, pte) \ 19static inline void pmd_populate_kernel(struct mm_struct *mm,
18do { \ 20 pmd_t *pmd, pte_t *pte)
19 paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT); \ 21{
20 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \ 22 paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT);
21} while (0) 23 set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE));
24}
22 25
23#define pmd_populate(mm, pmd, pte) \ 26static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte)
24do { \ 27{
25 paravirt_alloc_pt(mm, page_to_pfn(pte)); \ 28 unsigned long pfn = page_to_pfn(pte);
26 set_pmd(pmd, __pmd(_PAGE_TABLE + \ 29
27 ((unsigned long long)page_to_pfn(pte) << \ 30 paravirt_alloc_pt(mm, pfn);
28 (unsigned long long) PAGE_SHIFT))); \ 31 set_pmd(pmd, __pmd(((pteval_t)pfn << PAGE_SHIFT) | _PAGE_TABLE));
29} while (0) 32}
30 33
31/* 34/*
32 * Allocate and free page tables. 35 * Allocate and free page tables.
@@ -48,20 +51,34 @@ static inline void pte_free(struct page *pte)
48} 51}
49 52
50 53
51#define __pte_free_tlb(tlb,pte) \ 54static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
52do { \ 55{
53 paravirt_release_pt(page_to_pfn(pte)); \ 56 paravirt_release_pt(page_to_pfn(pte));
54 tlb_remove_page((tlb),(pte)); \ 57 tlb_remove_page(tlb, pte);
55} while (0) 58}
56 59
57#ifdef CONFIG_X86_PAE 60#ifdef CONFIG_X86_PAE
58/* 61/*
59 * In the PAE case we free the pmds as part of the pgd. 62 * In the PAE case we free the pmds as part of the pgd.
60 */ 63 */
61#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) 64static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
62#define pmd_free(x) do { } while (0) 65{
63#define __pmd_free_tlb(tlb,x) do { } while (0) 66 BUG();
64#define pud_populate(mm, pmd, pte) BUG() 67 return (pmd_t *)2;
65#endif 68}
69
70static inline void pmd_free(pmd_t *pmd)
71{
72}
73
74static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
75{
76}
77
78static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
79{
80 BUG();
81}
82#endif /* CONFIG_X86_PAE */
66 83
67#endif /* _I386_PGALLOC_H */ 84#endif /* _I386_PGALLOC_H */
diff --git a/include/asm-x86/pgtable-3level.h b/include/asm-x86/pgtable-3level.h
index 5af7a44ed902..62bb06575d5a 100644
--- a/include/asm-x86/pgtable-3level.h
+++ b/include/asm-x86/pgtable-3level.h
@@ -157,6 +157,4 @@ static inline unsigned long pte_pfn(pte_t pte)
157#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high }) 157#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
158#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } }) 158#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } })
159 159
160#define __pmd_free_tlb(tlb, x) do { } while (0)
161
162#endif /* _I386_PGTABLE_3LEVEL_H */ 160#endif /* _I386_PGTABLE_3LEVEL_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 4f3838adbb30..2c3ce4c69b25 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -6,6 +6,7 @@
6#include <linux/mmzone.h> 6#include <linux/mmzone.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/pagemap.h>
9 10
10#include <asm/atomic.h> 11#include <asm/atomic.h>
11#include <asm/page.h> 12#include <asm/page.h>