Skip to content

Commit

Permalink
Fix registering of cores in cpuset_domain on FDT based systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
strejda committed Dec 7, 2020
1 parent a25ed73 commit 1404960
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sys/arm64/arm64/mp_machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,28 +565,31 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
{
uint64_t target_cpu;
int domain;
u_int cpuid;

target_cpu = reg[0];
if (addr_size == 2) {
target_cpu <<= 32;
target_cpu |= reg[1];
}

/* Skip boot CPU */
if (__pcpu[0].pc_mpidr == (target_cpu & CPU_AFF_MASK))
return (TRUE);

if (!start_cpu(fdt_cpuid, target_cpu))
return (FALSE);
fdt_cpuid++;
/* Don't start boot CPU */
if (__pcpu[0].pc_mpidr == (target_cpu & CPU_AFF_MASK)) {
cpuid = 0;
} else {
if (!start_cpu(fdt_cpuid, target_cpu))
return (FALSE);
cpuid = fdt_cpuid;
fdt_cpuid++;
}

/* Try to read the numa node of this cpu */
if (vm_ndomains == 1 ||
OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0)
domain = 0;
__pcpu[fdt_cpuid].pc_domain = domain;
__pcpu[cpuid].pc_domain = domain;
if (domain < MAXMEMDOM)
CPU_SET(fdt_cpuid, &cpuset_domain[domain]);
CPU_SET(cpuid, &cpuset_domain[domain]);

return (TRUE);
}
Expand Down

0 comments on commit 1404960

Please sign in to comment.