aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2017-08-05 20:57:34 +0000
committerAndrew Turner <andrew@FreeBSD.org>2017-08-05 20:57:34 +0000
commit1f15260790397f69789953d489a75b1fbeb3c296 (patch)
tree06279b2143c5be07c7becee350dc6415a5034664 /sys/arm64/arm64/mp_machdep.c
parent8c59f334b97e5abdf5efb783d430b5cadca72bf8 (diff)
downloadsrc-1f15260790397f69789953d489a75b1fbeb3c296.tar.gz
src-1f15260790397f69789953d489a75b1fbeb3c296.zip
Mark each cpu in the appropriate cpuset_domain set. This allows devices to
handle cases where they can only run on a single domain. To allow all devices access to this set we need to move reading the domain earlier in the boot as it was previously handled in the CPU driver, however this is too late for the GICv3 ITS driver. Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=322109
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index 363cb7f6cb81..c7e8a8df1e9d 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -198,10 +198,6 @@ arm64_cpu_attach(device_t dev)
/* Set the device to start it later */
cpu_list[cpuid] = dev;
- /* Try to read the numa node of this cpu */
- OF_getencprop(ofw_bus_get_node(dev), "numa-node-id",
- &__pcpu[cpuid].pc_domain, sizeof(__pcpu[cpuid].pc_domain));
-
return (0);
}
@@ -535,6 +531,7 @@ static boolean_t
cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
{
uint64_t target_cpu;
+ int domain;
target_cpu = reg[0];
if (addr_size == 2) {
@@ -542,7 +539,17 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
target_cpu |= reg[1];
}
- return (start_cpu(id, target_cpu) ? TRUE : FALSE);
+ if (!start_cpu(id, target_cpu))
+ return (FALSE);
+
+ /* Try to read the numa node of this cpu */
+ if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) {
+ __pcpu[id].pc_domain = domain;
+ if (domain < MAXMEMDOM)
+ CPU_SET(id, &cpuset_domain[domain]);
+ }
+
+ return (TRUE);
}
#endif