RISC-V Patches for the 5.12 Merge Window, Part 2

I have a pair of patches that slipped through the cracks:
 
 * CPU hotplug has been enabled in the defconfigs
 * Some cleanups to setup_bootmem.
 
 There's also a single fix
 
 * Force NUMA to depend on SMP.  This fixes some randconfig build
   failures.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEKzw3R0RoQ7JKlDp6LhMZ81+7GIkFAmA6qxgTHHBhbG1lckBk
 YWJiZWx0LmNvbQAKCRAuExnzX7sYiTCcEACvIvNFU8SYup83ZHlc3KtZ+RXFmIVU
 fMrAnud0sp4ngfjewLJEioKh7g6W0ewm3u6XLaQIzkY0pQINnwy0W+gb6h4R9L2p
 bU9myXtcNHNBGoquaLp/AbIalfullk7CtzvursEEtqiUarjGKAHUqj3hFjedFLuM
 fUDRl5BOsgmWiGRmRFMO3TvwUjRf+L4zPVQpbOq67cxjbA8uKYTsXJAy9RiPKZES
 WI5IEWBwMaGLoH0Tso5pytywozaIJNizRVk0V4lErFaoQVInGb8zjUxxkwPx6ZSp
 avG1LW+7MdFE6B+EKgzK6IBNuMIlPpNbD7WyhUKjhkj/7GNelpxdqf7arc4n6qN7
 dcaYi+cBoHqU/rnNqZF2N37Qz8RnrRNey0h/XNEHNEMp83hvqWVmVnAvktDsV9mR
 RaTnSjS9IPhsi/f4v39C02XRaRIRO3eLt6HqyH4+Jd5Wo6hfS0FKlr2p9adXzX+W
 Vv0PL6kPtjXpJhVUEU4PWO5uv60dBv/EUncz8gj/bGSuYsDYC3lVjdn+r+LwB1z+
 MIpMaSsU42AI9X9GD8R3yaJdyNxnMs6wQd6OEVBDp9aK4UuIvhqItfE63EBrGj59
 SMbpVyqjM/TbdQdCnazqJSa1HeVjitID1WVejTDuAMIOP+vVMdWLv8LiJQmTCVoD
 Bnwna4zkyTk0cQ==
 =1f6g
 -----END PGP SIGNATURE-----

Merge tag 'riscv-for-linus-5.12-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull more RISC-V updates from Palmer Dabbelt:
 "A pair of patches that slipped through the cracks:

   - enable CPU hotplug in the defconfigs

   - some cleanups to setup_bootmem

  There's also a single fix for some randconfig build failures:

   - make NUMA depend on SMP"

* tag 'riscv-for-linus-5.12-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: Cleanup setup_bootmem()
  RISC-V: Enable CPU Hotplug in defconfigs
  RISC-V: Make NUMA depend on SMP
This commit is contained in:
Linus Torvalds 2021-02-28 12:01:23 -08:00
commit 7d19ea5e99
4 changed files with 5 additions and 19 deletions

View File

@ -314,6 +314,7 @@ endchoice
# Common NUMA Features
config NUMA
bool "NUMA Memory Allocation and Scheduler Support"
depends on SMP
select GENERIC_ARCH_NUMA
select OF_NUMA
select ARCH_SUPPORTS_NUMA_BALANCING

View File

@ -17,6 +17,7 @@ CONFIG_BPF_SYSCALL=y
CONFIG_SOC_SIFIVE=y
CONFIG_SOC_VIRT=y
CONFIG_SMP=y
CONFIG_HOTPLUG_CPU=y
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y

View File

@ -18,6 +18,7 @@ CONFIG_SOC_SIFIVE=y
CONFIG_SOC_VIRT=y
CONFIG_ARCH_RV32I=y
CONFIG_SMP=y
CONFIG_HOTPLUG_CPU=y
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y

View File

@ -108,34 +108,17 @@ void __init mem_init(void)
void __init setup_bootmem(void)
{
phys_addr_t mem_start = 0;
phys_addr_t start, dram_end, end = 0;
phys_addr_t vmlinux_end = __pa_symbol(&_end);
phys_addr_t vmlinux_start = __pa_symbol(&_start);
phys_addr_t dram_end = memblock_end_of_DRAM();
phys_addr_t max_mapped_addr = __pa(~(ulong)0);
u64 i;
/* Find the memory region containing the kernel */
for_each_mem_range(i, &start, &end) {
phys_addr_t size = end - start;
if (!mem_start)
mem_start = start;
if (start <= vmlinux_start && vmlinux_end <= end)
BUG_ON(size == 0);
}
/*
* The maximal physical memory size is -PAGE_OFFSET.
* Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed
* as it is unusable by kernel.
*/
/* The maximal physical memory size is -PAGE_OFFSET. */
memblock_enforce_memory_limit(-PAGE_OFFSET);
/* Reserve from the start of the kernel to the end of the kernel */
memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
dram_end = memblock_end_of_DRAM();
/*
* memblock allocator is not aware of the fact that last 4K bytes of
* the addressable memory can not be mapped because of IS_ERR_VALUE