aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2016-07-25 15:57:13 +0000
committerAndrew Turner <andrew@FreeBSD.org>2016-07-25 15:57:13 +0000
commit8ec2b5df7372a5f2235021659054684bc4ac6ff5 (patch)
tree5e28ce6a32d543da3aad360aa45cdac9485adc7b /sys/arm64/arm64/mp_machdep.c
parentabf5bdb4418b7a8bfeea1eda6ebbda0d0900175c (diff)
downloadsrc-8ec2b5df7372a5f2235021659054684bc4ac6ff5.tar.gz
src-8ec2b5df7372a5f2235021659054684bc4ac6ff5.zip
Rework how we number CPUs on arm64 to try and keep clusters together.
Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=303307
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index 5256dcfbdf4b..93af8072e4f2 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -454,9 +454,16 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
if (id == cpu0)
return (1);
+ /*
+ * Rotate the CPU IDs to put the boot CPU as CPU 0. We keep the other
+ * CPUs ordered as the are likely grouped into clusters so it can be
+ * useful to keep that property, e.g. for the GICv3 driver to send
+ * an IPI to all CPUs in the cluster.
+ */
cpuid = id;
if (cpuid < cpu0)
- cpuid++;
+ cpuid += mp_maxid + 1;
+ cpuid -= cpu0;
pcpup = &__pcpu[cpuid];
pcpu_init(pcpup, cpuid, sizeof(struct pcpu));