Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Drop support for memory hotplug and memory hotremove

Support for memory hotplug was restricted to 64-bit platforms in
7ec58a2b941e ("mm/memory_hotplug: restrict CONFIG_MEMORY_HOTPLUG
to 64 bit") while sh is a pure 32-bit platform since the removal
of sh5 support. Thus, drop support for memory hotplug and the
associated memory hotremove on this platform.

Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20240518115808.8888-2-osalvador@suse.de
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

authored by

Oscar Salvador and committed by
John Paul Adrian Glaubitz
a71ac6c9 1613e604

-34
-2
arch/sh/Kconfig
··· 3 3 def_bool y 4 4 select ARCH_32BIT_OFF_T 5 5 select ARCH_HAS_CPU_CACHE_ALIASING 6 - select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU 7 - select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU 8 6 select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A) 9 7 select ARCH_HAS_BINFMT_FLAT if !MMU 10 8 select ARCH_HAS_CPU_FINALIZE_INIT
-4
arch/sh/mm/Kconfig
··· 144 144 config ARCH_SELECT_MEMORY_MODEL 145 145 def_bool y 146 146 147 - config ARCH_MEMORY_PROBE 148 - def_bool y 149 - depends on MEMORY_HOTPLUG 150 - 151 147 config IOREMAP_FIXED 152 148 def_bool y 153 149 depends on X2TLB
-28
arch/sh/mm/init.c
··· 395 395 396 396 mem_init_done = 1; 397 397 } 398 - 399 - #ifdef CONFIG_MEMORY_HOTPLUG 400 - int arch_add_memory(int nid, u64 start, u64 size, 401 - struct mhp_params *params) 402 - { 403 - unsigned long start_pfn = PFN_DOWN(start); 404 - unsigned long nr_pages = size >> PAGE_SHIFT; 405 - int ret; 406 - 407 - if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot)) 408 - return -EINVAL; 409 - 410 - /* We only have ZONE_NORMAL, so this is easy.. */ 411 - ret = __add_pages(nid, start_pfn, nr_pages, params); 412 - if (unlikely(ret)) 413 - printk("%s: Failed, __add_pages() == %d\n", __func__, ret); 414 - 415 - return ret; 416 - } 417 - 418 - void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) 419 - { 420 - unsigned long start_pfn = PFN_DOWN(start); 421 - unsigned long nr_pages = size >> PAGE_SHIFT; 422 - 423 - __remove_pages(start_pfn, nr_pages, altmap); 424 - } 425 - #endif /* CONFIG_MEMORY_HOTPLUG */