未验证 提交 8b4302a4 编写于 作者: A Atish Patra 提交者: Palmer Dabbelt

RISC-V: Support nr_cpus command line option.

If nr_cpus command line option is set, maximum possible cpu should be
set to that value.
Signed-off-by: NAtish Patra <atish.patra@wdc.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
上级 ab3d2650
...@@ -84,11 +84,19 @@ void __init setup_smp(void) ...@@ -84,11 +84,19 @@ void __init setup_smp(void)
} }
cpuid_to_hartid_map(cpuid) = hart; cpuid_to_hartid_map(cpuid) = hart;
set_cpu_possible(cpuid, true);
cpuid++; cpuid++;
} }
BUG_ON(!found_boot_cpu); BUG_ON(!found_boot_cpu);
if (cpuid > nr_cpu_ids)
pr_warn("Total number of cpus [%d] is greater than nr_cpus option value [%d]\n",
cpuid, nr_cpu_ids);
for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) {
if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID)
set_cpu_possible(cpuid, true);
}
} }
int __cpu_up(unsigned int cpu, struct task_struct *tidle) int __cpu_up(unsigned int cpu, struct task_struct *tidle)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册