Commit 44dbcc93 authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Will Deacon

arm64: Fix behavior of maxcpus=N

maxcpu=n sets the number of CPUs activated at boot time to a max of n,
but allowing the remaining CPUs to be brought up later if the user
decides to do so. However, on arm64 due to various reasons, we disallowed
hotplugging CPUs beyond n, by marking them not present. Now that
we have checks in place to make sure the hotplugged CPUs have compatible
features with system and requires no new errata, relax the restriction.

Cc: Will Deacon <>
Cc: Mark Rutland <>
Cc: James Morse <>
Reviewed-by: default avatarCatalin Marinas <>
Signed-off-by: default avatarSuzuki K Poulose <>
Signed-off-by: default avatarWill Deacon <>
parent 6a6efbb4
......@@ -689,33 +689,18 @@ void __init smp_init_cpus(void)
void __init smp_prepare_cpus(unsigned int max_cpus)
int err;
unsigned int cpu, ncores = num_possible_cpus();
unsigned int cpu;
* are we trying to boot more cores than exist?
if (max_cpus > ncores)
max_cpus = ncores;
/* Don't bother if we're effectively UP */
if (max_cpus <= 1)
* Initialise the present map (which describes the set of CPUs
* actually populated at the present time) and release the
* secondaries from the bootloader.
* Make sure we online at most (max_cpus - 1) additional CPUs.
for_each_possible_cpu(cpu) {
if (max_cpus == 0)
if (cpu == smp_processor_id())
......@@ -728,7 +713,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
set_cpu_present(cpu, true);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment