Skip to content
Commit 058ddee5 authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM] Fix SMP booting with non-zero PHYS_OFFSET



The existing code tries to get the pmd for the temporary page table
by doing:

        pgd = pgd_alloc(&init_mm);
        pmd = pmd_offset(pgd, PHYS_OFFSET);

Since we have a two level page table, pmd_offset() is a no-op, so
this just has a casting effect from a pgd to a pmd - the address
argument is unused.  So this can't work.

Normally, we'd do:

	pgd = pgd_offset(&init_mm, PHYS_OFFSET);
	...
	pmd = pmd_offset(pgd, PHYS_OFFSET);

to get the pmd you want.  However, pgd_offset() takes the mm_struct,
not the (unattached) pgd we just allocated.  So, instead use:

        pgd = pgd_alloc(&init_mm);
        pmd = pmd_offset(pgd + pgd_index(PHYS_OFFSET), PHYS_OFFSET);

Reported-by: default avatarAntti P Miettinen <ananaza@iki.fi>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent afd2fc02
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment