@@ -531,11 +531,14 @@ void __noreturn fast_reboot_entry(void)
*/
if (this_cpu() != boot_cpu) {
this_cpu()->state = cpu_state_present;
- while (!fast_boot_release) {
+ sync();
+ if (!fast_boot_release) {
smt_lowest();
- sync();
+ while (!fast_boot_release)
+ barrier();
+ smt_medium();
}
- smt_medium();
+ sync();
cleanup_cpu_state();
__secondary_cpu_entry();
}
@@ -550,11 +553,12 @@ void __noreturn fast_reboot_entry(void)
continue;
/* XXX Add a callin timeout ? */
- while (cpu->state != cpu_state_present) {
+ if (cpu->state != cpu_state_present) {
smt_lowest();
- sync();
+ while (cpu->state != cpu_state_present)
+ barrier();
+ smt_medium();
}
- smt_medium();
}
prlog(PR_INFO, "RESET: Releasing secondaries...\n");
@@ -569,13 +573,16 @@ void __noreturn fast_reboot_entry(void)
continue;
/* XXX Add a callin timeout ? */
- while (cpu->state == cpu_state_present) {
+ if (cpu->state == cpu_state_present) {
smt_lowest();
- sync();
+ while (cpu->state == cpu_state_present)
+ barrier();
+ smt_medium();
}
- smt_medium();
}
+ sync();
+
prlog(PR_INFO, "RESET: All done, cleaning up...\n");
/* Clear release flag for next time */
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- core/fast-reboot.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)