Skip to content

Commit 1404960

Browse files
committed
Fix registering of cores in cpuset_domain on FDT based systems.
1 parent a25ed73 commit 1404960

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

sys/arm64/arm64/mp_machdep.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -565,28 +565,31 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
565565
{
566566
uint64_t target_cpu;
567567
int domain;
568+
u_int cpuid;
568569

569570
target_cpu = reg[0];
570571
if (addr_size == 2) {
571572
target_cpu <<= 32;
572573
target_cpu |= reg[1];
573574
}
574575

575-
/* Skip boot CPU */
576-
if (__pcpu[0].pc_mpidr == (target_cpu & CPU_AFF_MASK))
577-
return (TRUE);
578-
579-
if (!start_cpu(fdt_cpuid, target_cpu))
580-
return (FALSE);
581-
fdt_cpuid++;
576+
/* Don't start boot CPU */
577+
if (__pcpu[0].pc_mpidr == (target_cpu & CPU_AFF_MASK)) {
578+
cpuid = 0;
579+
} else {
580+
if (!start_cpu(fdt_cpuid, target_cpu))
581+
return (FALSE);
582+
cpuid = fdt_cpuid;
583+
fdt_cpuid++;
584+
}
582585

583586
/* Try to read the numa node of this cpu */
584587
if (vm_ndomains == 1 ||
585588
OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0)
586589
domain = 0;
587-
__pcpu[fdt_cpuid].pc_domain = domain;
590+
__pcpu[cpuid].pc_domain = domain;
588591
if (domain < MAXMEMDOM)
589-
CPU_SET(fdt_cpuid, &cpuset_domain[domain]);
592+
CPU_SET(cpuid, &cpuset_domain[domain]);
590593

591594
return (TRUE);
592595
}

0 commit comments

Comments
 (0)