Skip to content

Commit 50ee91b

Browse files
Kefeng Wangwildea01
authored andcommitted
arm64: Support hard limit of cpu count by nr_cpus
Enable the hard limit of cpu count by set boot options nr_cpus=x on arm64, and make a minor change about message when total number of cpu exceeds the limit. Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Reported-by: Shiyuan Hu <hushiyuan@huawei.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 29b4817 commit 50ee91b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/arm64/kernel/smp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,9 @@ void __init smp_init_cpus(void)
661661
acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
662662
acpi_parse_gic_cpu_interface, 0);
663663

664-
if (cpu_count > NR_CPUS)
665-
pr_warn("no. of cores (%d) greater than configured maximum of %d - clipping\n",
666-
cpu_count, NR_CPUS);
664+
if (cpu_count > nr_cpu_ids)
665+
pr_warn("Number of cores (%d) exceeds configured maximum of %d - clipping\n",
666+
cpu_count, nr_cpu_ids);
667667

668668
if (!bootcpu_valid) {
669669
pr_err("missing boot CPU MPIDR, not enabling secondaries\n");
@@ -677,7 +677,7 @@ void __init smp_init_cpus(void)
677677
* with entries in cpu_logical_map while initializing the cpus.
678678
* If the cpu set-up fails, invalidate the cpu_logical_map entry.
679679
*/
680-
for (i = 1; i < NR_CPUS; i++) {
680+
for (i = 1; i < nr_cpu_ids; i++) {
681681
if (cpu_logical_map(i) != INVALID_HWID) {
682682
if (smp_cpu_setup(i))
683683
cpu_logical_map(i) = INVALID_HWID;

0 commit comments

Comments
 (0)