[0/3] Restructure init sequence to set aside reserved memory earlier

Message ID 1707524971-146908-1-git-send-email-quic_obabatun@quicinc.com
Headers
Series Restructure init sequence to set aside reserved memory earlier |

Message

Oreoluwa Babatunde Feb. 10, 2024, 12:29 a.m. UTC
  The loongarch, openric, and sh architectures allocate memory from
memblock before it gets the chance to set aside reserved memory regions.
This means that there is a possibility for memblock to allocate from
memory regions that are supposed to be reserved.

This series makes changes to the arch specific setup code to call the
functions responsible for setting aside the reserved memory regions earlier
in the init sequence.
Hence, by the time memblock starts being used to allocate memory, the
reserved memory regions should already be set aside, and it will no
longer be possible for allocations to come from them.

I am currnetly using an arm64 device, and so I will need assistance from
the relevant arch maintainers to help check if this breaks anything from
compilation to device bootup.

Oreoluwa Babatunde (3):
  loongarch: Call arch_mem_init() before platform_init() in the init
    sequence
  openrisc: Call setup_memory() earlier in the init sequence
  sh: Call paging_init() earlier in the init sequence

 arch/loongarch/kernel/setup.c | 2 +-
 arch/openrisc/kernel/setup.c  | 6 +++---
 arch/sh/kernel/setup.c        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

--