]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/mm: Consolidate initmem_init()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Wed, 9 Apr 2025 12:28:15 +0000 (15:28 +0300)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 Apr 2025 20:02:30 +0000 (22:02 +0200)
commit35c3151a98a6e6f56552cff8dc7d59e8ef7aca50
treeedd11dca463bf742bb8797bcb4e6f4b36e3c4315
parent78a84fbfa4ffc4bb6e95560a909b2ac3efa0aad2
x86/mm: Consolidate initmem_init()

There are 4 wariants of initmem_init(), for 32 and 64 bits and for
CONFIG_NUMA enabled and disabled.

After commit bbeb69ce3013 ("x86/mm: Remove CONFIG_HIGHMEM64G support")
NUMA is not supported on 32 bit kernels anymore, and
arch/x86/mm/numa_32.c can be just deleted and setup_bootmem_allocator()
with completely misleading name can be folded into initmem_init().

For 64 bits the NUMA variant calls x86_numa_init() and !NUMA variant
sets all memory to node 0. The later can be split out into inline helper
called x86_numa_init() and then both initmem_init() functions become the
same.

Split out memblock_set_node() from initmem_init() for !NUMA on 64 bit
into x86_numa_init() helper and remove arch/x86/mm/numa_*.c that only
contained initmem_init() variants for NUMA configs.

Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Len Brown <len.brown@intel.com>
Link: https://lore.kernel.org/r/20250409122815.420041-1-rppt@kernel.org
arch/x86/include/asm/page_32_types.h
arch/x86/mm/Makefile
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
arch/x86/mm/mm_internal.h
arch/x86/mm/numa.c
arch/x86/mm/numa_32.c [deleted file]
arch/x86/mm/numa_64.c [deleted file]
arch/x86/mm/numa_internal.h [deleted file]