arm64: cover the .head.text section in the .text segment mapping
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 30 Mar 2016 15:43:08 +0000 (17:43 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 29 Jul 2016 16:59:49 +0000 (18:59 +0200)
commite9160351f5694071321e3806653e6d758b6c3d08
tree8e3d2d05e32500731baee81cee597c2fc1a75fd2
parent4ffdbe3671b85c35fce8fe919ccb13674095f303
arm64: cover the .head.text section in the .text segment mapping

Keeping .head.text out of the .text mapping buys us very little: its actual
payload is only 4 KB, most of which is padding, but the page alignment may
add up to 2 MB (in case of CONFIG_DEBUG_ALIGN_RODATA=y) of additional
padding to the uncompressed kernel Image.

Also, on 4 KB granule kernels, the 4 KB misalignment of .text forces us to
map the adjacent 56 KB of code without the PTE_CONT attribute, and since
this region contains things like the vector table and the GIC interrupt
handling entry point, this region is likely to benefit from the reduced TLB
pressure that results from PTE_CONT mappings.

So remove the alignment between the .head.text and .text sections, and use
the [_text, _etext) rather than the [_stext, _etext) interval for mapping
the .text segment.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 7eb90f2ff7e3ee814ff12f3cd909b965cdd4a869)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/mm/mmu.c