diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-03-19 15:30:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:30 -0400 |
commit | 1ec1fe73dfb711f9ea5a0ef8a7e3af5b6ac8b653 (patch) | |
tree | 8bd9c69ef81e161feae599580bbab84b58f11761 | |
parent | 4f76cd382213b29dd3658e3e1ea47c0c2be06f3c (diff) |
x86: xen unify x86 add common mm pgtable c fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/mm/pgtable.c | 18 | ||||
-rw-r--r-- | include/asm-x86/pgalloc_32.h | 17 |
2 files changed, 19 insertions, 16 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index d526b46ae188..ed16b7704a3c 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -200,6 +200,24 @@ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) | |||
200 | 200 | ||
201 | return 1; | 201 | return 1; |
202 | } | 202 | } |
203 | |||
204 | void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) | ||
205 | { | ||
206 | paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT); | ||
207 | |||
208 | /* Note: almost everything apart from _PAGE_PRESENT is | ||
209 | reserved at the pmd (PDPT) level. */ | ||
210 | set_pud(pudp, __pud(__pa(pmd) | _PAGE_PRESENT)); | ||
211 | |||
212 | /* | ||
213 | * According to Intel App note "TLBs, Paging-Structure Caches, | ||
214 | * and Their Invalidation", April 2007, document 317080-001, | ||
215 | * section 8.1: in PAE mode we explicitly have to flush the | ||
216 | * TLB via cr3 if the top-level pgd is changed... | ||
217 | */ | ||
218 | if (mm == current->active_mm) | ||
219 | write_cr3(read_cr3()); | ||
220 | } | ||
203 | #else /* !CONFIG_X86_PAE */ | 221 | #else /* !CONFIG_X86_PAE */ |
204 | /* No need to prepopulate any pagetable entries in non-PAE modes. */ | 222 | /* No need to prepopulate any pagetable entries in non-PAE modes. */ |
205 | static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) | 223 | static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) |
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h index d60edb14f85e..aaa322cb4b6e 100644 --- a/include/asm-x86/pgalloc_32.h +++ b/include/asm-x86/pgalloc_32.h | |||
@@ -62,23 +62,8 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
62 | 62 | ||
63 | extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); | 63 | extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); |
64 | 64 | ||
65 | static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) | 65 | extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); |
66 | { | ||
67 | paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT); | ||
68 | |||
69 | /* Note: almost everything apart from _PAGE_PRESENT is | ||
70 | reserved at the pmd (PDPT) level. */ | ||
71 | set_pud(pudp, __pud(__pa(pmd) | _PAGE_PRESENT)); | ||
72 | 66 | ||
73 | /* | ||
74 | * According to Intel App note "TLBs, Paging-Structure Caches, | ||
75 | * and Their Invalidation", April 2007, document 317080-001, | ||
76 | * section 8.1: in PAE mode we explicitly have to flush the | ||
77 | * TLB via cr3 if the top-level pgd is changed... | ||
78 | */ | ||
79 | if (mm == current->active_mm) | ||
80 | write_cr3(read_cr3()); | ||
81 | } | ||
82 | #endif /* CONFIG_X86_PAE */ | 67 | #endif /* CONFIG_X86_PAE */ |
83 | 68 | ||
84 | #endif /* _I386_PGALLOC_H */ | 69 | #endif /* _I386_PGALLOC_H */ |