arm64: place initial page tables above the kernel
authorMark Rutland <mark.rutland@arm.com>
Tue, 24 Jun 2014 15:51:35 +0000 (16:51 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 23 Jul 2014 11:58:04 +0000 (12:58 +0100)
commit0c0ec28f520fb65ab9439d458cd4f2fab8753063
tree743f3f98de7b643662a24f9d4419e560578e9217
parent83c5fe50e10a327e7f460f0c145aa65d9fa96b73
arm64: place initial page tables above the kernel

Currently we place swapper_pg_dir and idmap_pg_dir below the kernel
image, between PHYS_OFFSET and (PHYS_OFFSET + TEXT_OFFSET). However,
bootloaders may use portions of this memory below the kernel and we do
not parse the memory reservation list until after the MMU has been
enabled. As such we may clobber some memory a bootloader wishes to have
preserved.

To enable the use of all of this memory by bootloaders (when the
required memory reservations are communicated to the kernel) it is
necessary to move our initial page tables elsewhere. As we currently
have an effectively unbound requirement for memory at the end of the
kernel image for .bss, we can place the page tables here.

This patch moves the initial page table to the end of the kernel image,
after the BSS. As they do not consist of any initialised data they will
be stripped from the kernel Image as with the BSS. The BSS clearing
routine is updated to stop at __bss_stop rather than _end so as to not
clobber the page tables, and memory reservations made redundant by the
new organisation are removed.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit bd00cd5f8c8c3c282bb1e1eac6a6679a4f808091)
Signed-off-by: Mark Brown <broonie@linaro.org>
Conflicts:
arch/arm64/mm/init.c
arch/arm64/include/asm/page.h
arch/arm64/kernel/head.S
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/mm/init.c