aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2020-07-01 15:17:45 +0000
committerAndrew Turner <andrew@FreeBSD.org>2020-07-01 15:17:45 +0000
commit9eb07d5627afe7b23da841465afacf9450dce95c (patch)
tree19a621dc509e8dce95af02667a3a9bc9041dfb50 /sys/arm64/arm64/mp_machdep.c
parentecc8ccb44180ed9916e830baf2d9ef7d911e051a (diff)
downloadsrc-9eb07d5627afe7b23da841465afacf9450dce95c.tar.gz
src-9eb07d5627afe7b23da841465afacf9450dce95c.zip
Read the arm64 ID registers earlier in the boot process.
Also move parsing the registers to just after the secondary CPUs have started. This means the kernel register view from all CPUs is available after the CPU SYSINITs have finished, e.g. for use by ifunc resolvers. Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25505
Notes
Notes: svn path=/head/; revision=362837
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index e3b8e350dce4..b90873c65054 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -212,6 +212,19 @@ init_secondary(uint64_t cpu)
"mov x18, %0 \n"
"msr tpidr_el1, %0" :: "r"(pcpup));
+ /*
+ * Identify current CPU. This is necessary to setup
+ * affinity registers and to provide support for
+ * runtime chip identification.
+ *
+ * We need this before signalling the CPU is ready to
+ * let the boot CPU use the results.
+ */
+ identify_cpu();
+
+ /* Ensure the stores in identify_cpu have completed */
+ atomic_thread_fence_acq_rel();
+
/* Signal the BSP and spin until it has released all APs. */
atomic_add_int(&aps_started, 1);
while (!atomic_load_int(&aps_ready))
@@ -227,12 +240,6 @@ init_secondary(uint64_t cpu)
("pmap0 doesn't match cpu %ld's ttbr0", cpu));
pcpup->pc_curpmap = pmap0;
- /*
- * Identify current CPU. This is necessary to setup
- * affinity registers and to provide support for
- * runtime chip identification.
- */
- identify_cpu();
install_cpu_errata();
intr_pic_init_secondary();