Skip to content

Commit

Permalink
fast-reboot: add more barriers around cpu state changes
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
npiggin authored and stewartsmith committed Dec 4, 2017
1 parent 068de7b commit 171b785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/cpu.c
Expand Up @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion core/fast-reboot.c
Expand Up @@ -426,6 +426,7 @@ void fast_reboot(void)
lock(&reset_lock);

fast_boot_release = false;
sync();

success = fast_reset_p8();

Expand Down Expand Up @@ -576,8 +577,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);
Expand All @@ -597,7 +598,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();
Expand Down

0 comments on commit 171b785

Please sign in to comment.