aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@xensource.com>2008-02-13 10:20:35 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-13 10:20:35 -0500
commit37cc8d7f963ba2deec29c9b68716944516a3244f (patch)
tree33aa30fe472dad9d8f91d1ef653c6be57425e2b4 /arch/x86
parent416e2d63794d4e57774989429e174507801915f2 (diff)
x86/early_ioremap: don't assume we're using swapper_pg_dir
At the early stages of boot, before the kernel pagetable has been fully initialized, a Xen kernel will still be running off the Xen-provided pagetables rather than swapper_pg_dir[]. Therefore, readback cr3 to determine the base of the pagetable rather than assuming swapper_pg_dir[]. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Tested-by: Jody Belka <knew-linux@pimb.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/mm/ioremap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index a4897a85268a..9f42d7e9c158 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -265,7 +265,9 @@ static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
265 265
266static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) 266static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
267{ 267{
268 pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)]; 268 /* Don't assume we're using swapper_pg_dir at this point */
269 pgd_t *base = __va(read_cr3());
270 pgd_t *pgd = &base[pgd_index(addr)];
269 pud_t *pud = pud_offset(pgd, addr); 271 pud_t *pud = pud_offset(pgd, addr);
270 pmd_t *pmd = pmd_offset(pud, addr); 272 pmd_t *pmd = pmd_offset(pud, addr);
271 273