Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 8b4302a4 authored by Atish Patra's avatar Atish Patra Committed by Palmer Dabbelt
Browse files

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: default avatarAtish Patra <atish.patra@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent ab3d2650
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -84,11 +84,19 @@ void __init setup_smp(void)
		}

		cpuid_to_hartid_map(cpuid) = hart;
		set_cpu_possible(cpuid, true);
		cpuid++;
	}

	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)