mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
powerpc/smp: Increase nr_cpu_ids to include the boot CPU
[ Upstream commit 777f81f0a9
]
If nr_cpu_ids is too low to include the boot CPU adjust nr_cpu_ids
upward. Otherwise the kernel will BUG when trying to allocate a paca
for the boot CPU and fail to boot.
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231229120107.2281153-2-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
334fb14389
commit
605ddb3a6e
1 changed files with 6 additions and 0 deletions
|
@ -375,6 +375,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
|||
nr_cpu_ids);
|
||||
}
|
||||
|
||||
if (boot_cpuid >= nr_cpu_ids) {
|
||||
set_nr_cpu_ids(min(CONFIG_NR_CPUS, ALIGN(boot_cpuid + 1, nthreads)));
|
||||
pr_warn("Boot CPU %d >= nr_cpu_ids, adjusted nr_cpu_ids to %d\n",
|
||||
boot_cpuid, nr_cpu_ids);
|
||||
}
|
||||
|
||||
/*
|
||||
* PAPR defines "logical" PVR values for cpus that
|
||||
* meet various levels of the architecture:
|
||||
|
|
Loading…
Reference in a new issue