Testing pc_curpcb != NULL is racy, since on arm64 its initially set in
pmap_switch(), where the bootstack is still in use. Take a different
approach: wait for APs to acknowledge an interrupt before freeing the
bootstacks.
Reported by: mmel
Differential D35435
arm64: Fix the condition used to test for AP initialization markj on Jun 8 2022, 2:28 PM. Authored by Tags None Referenced Files
Details Testing pc_curpcb != NULL is racy, since on arm64 its initially set in Reported by: mmel
Diff Detail
Event TimelineComment Actions Could we not move setting the stack pointer earlier in cpu_throw? If it was before pmap_switch we will have switched away from the boot stack before curpcb is set. Comment Actions I think that could work too, but isn't this method simpler and less tied to the internals of cpu_throw? This approach should work on all platforms, not just arm64. Comment Actions It solved my problem and it boots without any problems on all my arm64 boards. Thanks. Comment Actions @kib do you see any problem with adopting the same approach on other platforms, i.e., x86 and riscv?
Comment Actions
|