diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-03-19 20:30:40 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 23:57:30 +0200 |
commit | 1ec1fe73dfb711f9ea5a0ef8a7e3af5b6ac8b653 (patch) | |
tree | 8bd9c69ef81e161feae599580bbab84b58f11761 /arch/x86/mm/pgtable.c | |
parent | 4f76cd382213b29dd3658e3e1ea47c0c2be06f3c (diff) | |
download | blackbird-op-linux-1ec1fe73dfb711f9ea5a0ef8a7e3af5b6ac8b653.tar.gz blackbird-op-linux-1ec1fe73dfb711f9ea5a0ef8a7e3af5b6ac8b653.zip |
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>
Diffstat (limited to 'arch/x86/mm/pgtable.c')
-rw-r--r-- | arch/x86/mm/pgtable.c | 18 |
1 files changed, 18 insertions, 0 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) return 1; } + +void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) +{ + paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT); + + /* Note: almost everything apart from _PAGE_PRESENT is + reserved at the pmd (PDPT) level. */ + set_pud(pudp, __pud(__pa(pmd) | _PAGE_PRESENT)); + + /* + * According to Intel App note "TLBs, Paging-Structure Caches, + * and Their Invalidation", April 2007, document 317080-001, + * section 8.1: in PAE mode we explicitly have to flush the + * TLB via cr3 if the top-level pgd is changed... + */ + if (mm == current->active_mm) + write_cr3(read_cr3()); +} #else /* !CONFIG_X86_PAE */ /* No need to prepopulate any pagetable entries in non-PAE modes. */ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) |