Skip to content

Commit

Permalink
x86/early_ioremap: don't assume we're using swapper_pg_dir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Feb 13, 2008
1 parent 416e2d6 commit 37cc8d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]

static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
{
pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
/* Don't assume we're using swapper_pg_dir at this point */
pgd_t *base = __va(read_cr3());
pgd_t *pgd = &base[pgd_index(addr)];
pud_t *pud = pud_offset(pgd, addr);
pmd_t *pmd = pmd_offset(pud, addr);

Expand Down

0 comments on commit 37cc8d7

Please sign in to comment.