The branch main has been updated by andrew:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=38fd088a5db2194863718983866fab9f402bcf8e

commit 38fd088a5db2194863718983866fab9f402bcf8e
Author:     Andrew Turner <and...@freebsd.org>
AuthorDate: 2025-06-02 09:56:41 +0000
Commit:     Andrew Turner <and...@freebsd.org>
CommitDate: 2025-06-02 09:56:41 +0000

    arm64: Move users of sanitised ID registers later
    
    To allow for masking of ID registers in the presence of errata move
    the late ifunc resolvers and CPU identification functions until after
    the errata detection has run.
    
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D50571
---
 sys/arm64/arm64/identcpu.c | 7 ++++++-
 sys/arm64/arm64/machdep.c  | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c
index 16af88dd3c97..fe10e0eb551a 100644
--- a/sys/arm64/arm64/identcpu.c
+++ b/sys/arm64/arm64/identcpu.c
@@ -2797,7 +2797,12 @@ identify_cpu_sysinit(void *dummy __unused)
        install_sys_handler(user_ctr_handler);
        install_sys_handler(user_idreg_handler);
 }
-SYSINIT(identify_cpu, SI_SUB_CPU, SI_ORDER_MIDDLE, identify_cpu_sysinit, NULL);
+/*
+ * This needs to be after the APs have stareted as they may have errata that
+ * means we need to mask out ID registers & that could affect hwcaps, etc.
+ */
+SYSINIT(identify_cpu, SI_SUB_CONFIGURE, SI_ORDER_ANY, identify_cpu_sysinit,
+    NULL);
 
 static void
 cpu_features_sysinit(void *dummy __unused)
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 7cacc77173a4..53856dd90cae 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -263,7 +263,9 @@ late_ifunc_resolve(void *dummy __unused)
 {
        link_elf_late_ireloc();
 }
-SYSINIT(late_ifunc_resolve, SI_SUB_CPU, SI_ORDER_ANY, late_ifunc_resolve, 
NULL);
+/* Late enough for cpu_feat to have completed */
+SYSINIT(late_ifunc_resolve, SI_SUB_CONFIGURE, SI_ORDER_ANY,
+    late_ifunc_resolve, NULL);
 
 int
 cpu_idle_wakeup(int cpu)

Reply via email to