aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-06-25 00:19:02 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 07:10:27 -0400
commitbb23e403e5162765dabe3dc78646724753d6359b (patch)
treeec0e5c99079d6059694326f2fae9c862274e3c8a /arch/x86/mm
parentfc8b8a60ffa7c89da58c75109dacf0b2798c7caf (diff)
x86, 64-bit: use p??_populate() to attach pages to pagetable
Use the _populate() functions to attach new pages to a pagetable, to make sure the right paravirt_ops calls get called. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: xen-devel <xen-devel@lists.xensource.com> Cc: Stephen Tweedie <sct@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init_64.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 54a98407be3f..bfea7605eaab 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -167,7 +167,7 @@ set_pte_vaddr(unsigned long vaddr, pte_t new_pte)
167 pud = pud_offset(pgd, vaddr); 167 pud = pud_offset(pgd, vaddr);
168 if (pud_none(*pud)) { 168 if (pud_none(*pud)) {
169 pmd = (pmd_t *) spp_getpage(); 169 pmd = (pmd_t *) spp_getpage();
170 set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER)); 170 pud_populate(&init_mm, pud, pmd);
171 if (pmd != pmd_offset(pud, 0)) { 171 if (pmd != pmd_offset(pud, 0)) {
172 printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n", 172 printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
173 pmd, pmd_offset(pud, 0)); 173 pmd, pmd_offset(pud, 0));
@@ -177,7 +177,7 @@ set_pte_vaddr(unsigned long vaddr, pte_t new_pte)
177 pmd = pmd_offset(pud, vaddr); 177 pmd = pmd_offset(pud, vaddr);
178 if (pmd_none(*pmd)) { 178 if (pmd_none(*pmd)) {
179 pte = (pte_t *) spp_getpage(); 179 pte = (pte_t *) spp_getpage();
180 set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER)); 180 pmd_populate_kernel(&init_mm, pmd, pte);
181 if (pte != pte_offset_kernel(pmd, 0)) { 181 if (pte != pte_offset_kernel(pmd, 0)) {
182 printk(KERN_ERR "PAGETABLE BUG #02!\n"); 182 printk(KERN_ERR "PAGETABLE BUG #02!\n");
183 return; 183 return;
@@ -389,7 +389,7 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end)
389 pmd = alloc_low_page(&pmd_phys); 389 pmd = alloc_low_page(&pmd_phys);
390 390
391 spin_lock(&init_mm.page_table_lock); 391 spin_lock(&init_mm.page_table_lock);
392 set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE)); 392 pud_populate(&init_mm, pud, __va(pmd_phys));
393 last_map_addr = phys_pmd_init(pmd, addr, end); 393 last_map_addr = phys_pmd_init(pmd, addr, end);
394 spin_unlock(&init_mm.page_table_lock); 394 spin_unlock(&init_mm.page_table_lock);
395 395
@@ -592,7 +592,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
592 next = end; 592 next = end;
593 last_map_addr = phys_pud_init(pud, __pa(start), __pa(next)); 593 last_map_addr = phys_pud_init(pud, __pa(start), __pa(next));
594 if (!after_bootmem) 594 if (!after_bootmem)
595 set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys)); 595 pgd_populate(&init_mm, pgd_offset_k(start),
596 __va(pud_phys));
596 unmap_low_page(pud); 597 unmap_low_page(pud);
597 } 598 }
598 599