diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2016-05-14 18:22:52 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2016-05-14 18:22:52 +0000 |
| commit | fdce57a04219d7a36c6646950fde6c8bcd97c044 (patch) | |
| tree | 0f443e2c4c306207e1367f675cf582d2e838e142 /sys/dev/xen/control | |
| parent | c9aad79aa9018f768dc594ef5bece5ce00ab42bc (diff) | |
Notes
Diffstat (limited to 'sys/dev/xen/control')
| -rw-r--r-- | sys/dev/xen/control/control.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index a62b2cae45fa..ae13c6c10078 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -202,11 +202,18 @@ xctrl_suspend() stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + thread_lock(curthread); + sched_bind(curthread, 0); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_bind(curthread, 0); thread_unlock(curthread); } +#endif KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* @@ -227,6 +234,17 @@ xctrl_suspend() } #ifdef SMP +#ifdef EARLY_AP_STARTUP + /* + * Suspend other CPUs. This prevents IPIs while we + * are resuming, and will allow us to reset per-cpu + * vcpu_info on resume. + */ + cpu_suspend_map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &cpu_suspend_map); + if (!CPU_EMPTY(&cpu_suspend_map)) + suspend_cpus(cpu_suspend_map); +#else CPU_ZERO(&cpu_suspend_map); /* silence gcc */ if (smp_started) { /* @@ -240,6 +258,7 @@ xctrl_suspend() suspend_cpus(cpu_suspend_map); } #endif +#endif /* * Prevent any races with evtchn_interrupt() handler. @@ -285,11 +304,17 @@ xctrl_suspend() timecounter->tc_get_timecount(timecounter); inittodr(time_second); +#ifdef EARLY_AP_STARTUP + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } +#endif resume_all_proc(); |
