summaryrefslogtreecommitdiffstats
path: root/sys/i386/i386/mp_machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/i386/mp_machdep.c')
-rw-r--r--sys/i386/i386/mp_machdep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 60b36a2..1d6d58a 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -1529,6 +1529,10 @@ cpususpend_handler(void)
cpu = PCPU_GET(cpuid);
+#ifdef XENHVM
+ mtx_assert(&smp_ipi_mtx, MA_NOTOWNED);
+#endif
+
if (savectx(susppcbs[cpu])) {
wbinvd();
CPU_SET_ATOMIC(cpu, &suspended_cpus);
@@ -1545,10 +1549,22 @@ cpususpend_handler(void)
while (!CPU_ISSET(cpu, &started_cpus))
ia32_pause();
+#ifdef XENHVM
+ /*
+ * Reset pending bitmap IPIs, because Xen doesn't preserve pending
+ * event channels on migration.
+ */
+ cpu_ipi_pending[cpu] = 0;
+ /* register vcpu_info area */
+ xen_hvm_init_cpu();
+#endif
+
/* Resume MCA and local APIC */
mca_resume();
lapic_setup(0);
+ /* Indicate that we are resumed */
+ CPU_CLR_ATOMIC(cpu, &suspended_cpus);
CPU_CLR_ATOMIC(cpu, &started_cpus);
}
/*
OpenPOWER on IntegriCloud