OSDN Git Service

ARM: 9090/1: Map the lowmem and kernel separately
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 3 Jun 2021 08:52:02 +0000 (09:52 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sun, 13 Jun 2021 17:16:42 +0000 (18:16 +0100)
commit6e121df14ccd5ca5142a21759beda7f12db0002b
tree1c11826acb0a652733c5a7b83c596ac0f5dacb7f
parenta91da54570856e3d3af4ba2884db71fbce06f70b
ARM: 9090/1: Map the lowmem and kernel separately

Using our knowledge of where the physical kernel sections start
and end we can split mapping of lowmem and kernel apart.

This is helpful when you want to place the kernel independently
from lowmem and not be limited to putting it into lowmem only,
but also into places such as the VMALLOC area.

We extensively rewrite the lowmem mapping code to account for
all cases where the kernel image overlaps with the lowmem in
different ways. This is helpful to handle situations which
occur when the kernel is loaded in different places and makes
it possible to place the kernel in a more random manner
which is done with e.g. KASLR.

We sprinkle some comments with illustrations and pr_debug()
over it so it is also very evident to readers what is happening.

We now use the kernel_sec_start and kernel_sec_end instead
of relying on __pa() (phys_to_virt) to provide this. This
is helpful if we want to resolve physical-to-virtual and
virtual-to-physical mappings at runtime rather than
compiletime, especially if we are not using patch phys to
virt.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mm/mmu.c