summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index f6f7f8d7f9d..5e96b0266bd 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -395,11 +395,26 @@ hibernate_disable_intr_machdep(void)
void
hibernate_quiesce_cpus(void)
{
+ int i;
+
+ KASSERT(CPU_IS_PRIMARY(curcpu()));
+
/* Start the hatched (but idling) APs */
cpu_boot_secondary_processors();
sched_start_secondary_cpus();
- /* Now shut them down */
- acpi_sleep_mp();
+ /*
+ * Wait for cpus to halt so we know their FPU state has been
+ * saved and their caches have been written back.
+ */
+ x86_broadcast_ipi(X86_IPI_HALT_REALMODE);
+ for (i = 0; i < ncpus; i++) {
+ struct cpu_info *ci = cpu_info[i];
+
+ if (CPU_IS_PRIMARY(ci))
+ continue;
+ while (ci->ci_flags & CPUF_RUNNING)
+ ;
+ }
}
#endif /* MULTIPROCESSOR */