Re: [PATCH v3 5/6] sparc32: move early memory setup to setup_arch
From: Sam Ravnborg
Date: Wed Sep 02 2026 - 01:36:33 EST
On Tue, Sep 01, 2026 at 11:45:49PM +0200, Magnus Lindholm wrote:
> Move the early memory configuration out of SRMMU paging setup and next to
> the rest of setup_arch(). Derive the PFN limits from memblock, reserve the
> kernel and initrd there, and retain mem= support with
> memblock_enforce_memory_limit().
>
> Use for_each_mem_pfn_range() to find the lowmem boundary and replace
> last_valid_pfn with the standard max_low_pfn variable. Set the standard
> max_pfn variable to the end of physical memory and use it as the highmem
> zone limit. This tightens LEON's _pfn_valid() upper bound from all RAM to
> the lowmem limit, with no functional change because LEON does not use
> highmem.
>
> The removed bootmem code also printed a private HIGHMEM summary. Generic
> memory initialization already reports the highmem zone, so do not retain
> the duplicate message.
>
> When PAGE_OFFSET maps a relocated kernel, remove memory below phys_base
> from memblock because it cannot be reached through the linear map. This
> replaces the equivalent trimming of sp_banks.
>
> Suggested-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
> Signed-off-by: Magnus Lindholm <linmag7@xxxxxxxxx>
Looks good!
Reviewed-by: Sam Ravnborg <sam@xxxxxxxxxxxx>