@@ -1126,7 +1126,10 @@ void cpu_bringup(void)
void cpu_callin(struct cpu_thread *cpu)
{
+ sync();
cpu->state = cpu_state_active;
+ sync();
+
cpu->job_has_no_return = false;
init_hid();
@@ -424,6 +424,7 @@ void fast_reboot(void)
lock(&reset_lock);
fast_boot_release = false;
+ sync();
success = fast_reset_p8();
@@ -574,8 +575,8 @@ void __noreturn fast_reboot_entry(void)
prlog(PR_INFO, "RESET: Releasing secondaries...\n");
/* Release everybody */
- fast_boot_release = true;
sync();
+ fast_boot_release = true;
/* Wait for them to respond */
cpu_state_wait_all_others(cpu_state_active, 0);
@@ -595,7 +596,9 @@ void __noreturn fast_reboot_entry(void)
cleanup_cpu_state();
/* Set our state to active */
+ sync();
this_cpu()->state = cpu_state_active;
+ sync();
/* Let the CPU layer do some last minute global cleanups */
cpu_fast_reboot_complete();
This is a bit of paranoia, but when a CPU changes state to signal it has reached a particular point, all previous stores should be visible. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- core/cpu.c | 3 +++ core/fast-reboot.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-)