mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core
[ Upstream commit 5580e96dad
]
If nr_cpu_ids is too low to include at least all the threads of a single
core adjust nr_cpu_ids upwards. This avoids triggering odd bugs in code
that assumes all threads of a core are available.
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231229120107.2281153-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
14cdbd9440
commit
334fb14389
1 changed files with 6 additions and 0 deletions
|
@ -369,6 +369,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
|||
if (IS_ENABLED(CONFIG_PPC64))
|
||||
boot_cpu_hwid = be32_to_cpu(intserv[found_thread]);
|
||||
|
||||
if (nr_cpu_ids % nthreads != 0) {
|
||||
set_nr_cpu_ids(ALIGN(nr_cpu_ids, nthreads));
|
||||
pr_warn("nr_cpu_ids was not a multiple of threads_per_core, adjusted to %d\n",
|
||||
nr_cpu_ids);
|
||||
}
|
||||
|
||||
/*
|
||||
* PAPR defines "logical" PVR values for cpus that
|
||||
* meet various levels of the architecture:
|
||||
|
|
Loading…
Reference in a new issue