mbox series

[0/5] sparc32: replace sp_banks with memblock

Message ID 20260827182757.6856-1-linmag7@gmail.com
Headers show
Series sparc32: replace sp_banks with memblock | expand

Message

Magnus Lindholm Aug. 27, 2026, 6:24 p.m. UTC
Replace the sparc32-private sp_banks memory description with memblock.

The first two patches convert the SRMMU consumers that already run after
bootmem_init() has populated memblock. The third patch moves memblock
population to prom_meminit() and applies the mem= limit there, keeping that
intermediate state correct. The fourth patch moves the early memory setup
into setup_32.c and the final patch removes the now-unused sp_banks array.

This work is based on an earlier eight-patch series by Sam Ravnborg.
Patch 2 directly carries over Sam's memblock sizing conversion. The series
has otherwise been substantially reorganized and reworked for the current
kernel. Compared with Sam's series, this version is ported to the current
generic MM setup, keeps the sparc32 mem= command-line option by using
memblock_enforce_memory_limit(), and uses memblock's exclusive range-end
semantics throughout.

The series is based on top of the sparc32 phys_base and Viking fixes. In
particular, setup_memory() preserves the relocated-kernel handling by
removing RAM below the physical address to which PAGE_OFFSET maps.

This series is boot tested on a Sun SPARCstation-20 with dual
Supersparc-II cpu (SM71) as well as dual Hypersparc RT626.

Suggested-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20260817153237.GA702187@ravnborg.org

Magnus Lindholm (5):
  sparc32: use memblock when mapping the kernel
  sparc32: use memblock to find available system memory
  sparc32: populate memblock from the PROM memory map
  sparc32: move early memory setup to setup_arch
  sparc32: drop sp_banks

 arch/sparc/include/asm/page_32.h    |  16 ----
 arch/sparc/include/asm/pgtable_32.h |   3 +-
 arch/sparc/kernel/setup_32.c        | 118 +++++++++++++----------
 arch/sparc/mm/init_32.c             | 139 +---------------------------
 arch/sparc/mm/srmmu.c               |  65 +++++--------
 arch/sparc/prom/memory.c            |  51 ++--------
 6 files changed, 104 insertions(+), 288 deletions(-)


base-commit: 982260b3f81e405af4a65a3029399840a2d2a4be

Comments

Sam Ravnborg Aug. 29, 2026, 6:29 a.m. UTC | #1
Hi Magnus.

On Thu, Aug 27, 2026 at 08:24:12PM +0200, Magnus Lindholm wrote:
> Replace the sparc32-private sp_banks memory description with memblock.
> 
> The first two patches convert the SRMMU consumers that already run after
> bootmem_init() has populated memblock. The third patch moves memblock
> population to prom_meminit() and applies the mem= limit there, keeping that
> intermediate state correct. The fourth patch moves the early memory setup
> into setup_32.c and the final patch removes the now-unused sp_banks array.
> 
> This work is based on an earlier eight-patch series by Sam Ravnborg.
> Patch 2 directly carries over Sam's memblock sizing conversion. The series
> has otherwise been substantially reorganized and reworked for the current
> kernel. Compared with Sam's series, this version is ported to the current
> generic MM setup, keeps the sparc32 mem= command-line option by using
> memblock_enforce_memory_limit(), and uses memblock's exclusive range-end
> semantics throughout.
Thanks for picking this up!
Patches 1,2,3,5 are:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

I left some comments in patch 4.

	Sam
Magnus Lindholm Aug. 29, 2026, 8:54 a.m. UTC | #2
Hi Sam,

On Sat, Aug 29, 2026 at 8:29 AM Sam Ravnborg <sam@ravnborg.org> wrote:

> Patches 1,2,3,5 are:
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
>
> I left some comments in patch 4.
>

Thanks alot for taking the time to review this, I'll pick up your tags
and address
your comments in a v2 of this series.

Regards

Magnus