[PATCH 0/3] Split lowmem and kernel mappings

Linus Walleij linus.walleij at linaro.org
Mon May 17 07:57:16 PDT 2021


This patch set of 3 patches is the beginnings of an idea
from Arnd: to move the kernel image (executable and
non-executable sections) into the VMALLOC area.

To get there we first need to pry apart the section
mappings of lowmem and the kernel.

This series:

- Creates a specific KERNEL_OFFSET and removes the implied
  assumption that the kernel will always start at PAGE_OFFSET.

- Saves the kernel physical section start and end addresses
  from the early assembly-coded section mappings so we can
  reuse these later without having to rely on
  virtual-to-physical mappings.

- Splits the map_lowmem() function into two: map_lowmem()
  which maps the lowmem proper and map_kernel() that maps
  the kernel. The split is nice (IMO) because the functions
  become cleaner and easier to read. It is possible that
  the refactoring of map_lowmem() also avoids a few
  pitfalls from the earlier code.

I have a prototype patch that on top of this actually moves
the kernel into the VMALLOC area at 0xf1000000 but I want
to keep things apart to avoid too much discussion and
confusion. One thing at the time. I think these patches
are fine in their own right, but I wrote them so I need
others to think the same.

If you want to see the prototype patch(es) it is here:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/log/?h=kernel-in-vmalloc-v5.13-rc1

Linus Walleij (3):
  ARM: Split KERNEL_OFFSET from PAGE_OFFSET
  ARM: Define kernel physical section start and end
  ARM: Map the lowmem and kernel separately

 arch/arm/include/asm/memory.h |  15 +++-
 arch/arm/kernel/head.S        |  30 +++++--
 arch/arm/kernel/vmlinux.lds.S |   2 +-
 arch/arm/mm/mmu.c             | 144 ++++++++++++++++++++++++++--------
 4 files changed, 151 insertions(+), 40 deletions(-)

-- 
2.31.1




More information about the linux-arm-kernel mailing list