Page MenuHomeFreeBSD

D30655.diff
No OneTemporary

D30655.diff

diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c
--- a/sys/riscv/riscv/mp_machdep.c
+++ b/sys/riscv/riscv/mp_machdep.c
@@ -532,9 +532,9 @@
void
cpu_mp_setmaxid(void)
{
-#ifdef FDT
int cores;
+#ifdef FDT
cores = ofw_cpu_early_foreach(cpu_check_mmu, true);
if (cores > 0) {
cores = MIN(cores, MAXCPU);
@@ -543,12 +543,19 @@
mp_ncpus = cores;
mp_maxid = cores - 1;
cpu_enum_method = CPUS_FDT;
- return;
- }
+ } else
#endif
+ {
+ if (bootverbose)
+ printf("No CPU data, limiting to 1 core\n");
+ mp_ncpus = 1;
+ mp_maxid = 0;
+ }
- if (bootverbose)
- printf("No CPU data, limiting to 1 core\n");
- mp_ncpus = 1;
- mp_maxid = 0;
+ if (TUNABLE_INT_FETCH("hw.ncpu", &cores)) {
+ if (cores > 0 && cores < mp_ncpus) {
+ mp_ncpus = cores;
+ mp_maxid = cores - 1;
+ }
+ }
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 10:43 PM (8 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16217708
Default Alt Text
D30655.diff (828 B)

Event Timeline