aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2025-11-18 18:00:32 +0000
committerAndrew Turner <andrew@FreeBSD.org>2025-11-18 18:00:32 +0000
commita695ac2ce8bc8e8b989359002659063f2e056dcf (patch)
treea75e962b215bddff89e503bdd6ff72305aaa3249
parent2188e77bfdecfe6d7fa2007f64a471fdaa045892 (diff)
arm64: Move intr_pic_init_secondary earlier
This may have been called after intr_irq_shuffle. For most interrupt controllers this appears to be safe, however for the GICv5 we need to read a per-CPU ID register before we can assign interrupts to a given CPU. Fix the race by moving intr_pic_init_secondary earlier in the boot, after devices have been enumerated and before the interrupts are moved to their assigned CPUs. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D53685
-rw-r--r--sys/arm64/arm64/mp_machdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index 0bdd2ecfd8a7..ba673ce9d6ee 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -270,6 +270,8 @@ init_secondary(uint64_t cpu)
install_cpu_errata();
enable_cpu_feat(CPU_FEAT_AFTER_DEV);
+ intr_pic_init_secondary();
+
/* Signal we are done */
atomic_add_int(&aps_started, 1);
@@ -288,8 +290,6 @@ init_secondary(uint64_t cpu)
("pmap0 doesn't match cpu %ld's ttbr0", cpu));
pcpup->pc_curpmap = pmap0;
- intr_pic_init_secondary();
-
/* Start per-CPU event timers. */
cpu_initclocks_ap();