Re: [PATCH v3] sh: Restructure setup code to reserve memory regions earlier

From: John Paul Adrian Glaubitz
Date: Thu Jul 11 2024 - 06:27:33 EST


Hi Oreoluwa,

On Mon, 2024-05-20 at 10:58 -0700, Oreoluwa Babatunde wrote:
> The unflatten_device_tree() function contains a call to
> memblock_alloc(). This is a problem because this allocation is done
> before any of the reserved memory regions are set aside in
> paging_init().
> As a result, there is a possibility for memblock to unknowingly allocate
> from any of the memory regions that are meant to be reserved.
>
> Hence, restructure the setup code to set aside reserved memory
> regions before any allocations are done using memblock.

Let me test this first to see whether this causes any regressions on my
J2 board. Afterwards, I will review and merge the patch to my SH tree.

Sorry for taking so long for this.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913