Displaying 2 results from an estimated 2 matches for "_vpf_need_sync".
2007 Jun 27
10
[PATCH 6/10] Allow vcpu to pause self
...-off-by Kevin Tian <kevin.tian@intel.com>
diff -r d5315422dbc8 xen/common/domain.c
--- a/xen/common/domain.c Mon May 14 18:35:31 2007 -0400
+++ b/xen/common/domain.c Mon May 14 20:21:04 2007 -0400
@@ -530,6 +530,17 @@ void vcpu_pause_nosync(struct vcpu *v)
vcpu_sleep_nosync(v);
}
+/* _VPF_need_sync serves not only as flag for sync pause, but also
+ * as hint for other cpu waiting for this pause.
+ */
+void vcpu_pause_self(void)
+{
+ struct vcpu *v = current;
+
+ set_bit(_VPF_need_sync, &v->pause_flags);
+ vcpu_pause_nosync(v);
+}
+
void vcpu_unpause(struct vcpu *v)
{
if...
2007 Jun 27
1
[PATCH 7/10] SMP support to Xen PM
...*/
+ if (cpu != 0)
+ return;
+
+ pmprintk(XENLOG_DEBUG, "handled by cpu0\n");
+ /* Wait vcpu0/dom0 to be paused */
+ while ( !atomic_read(&v->pause_count) )
+ cpu_relax();
+
+ /* Then wait for context of vcpu/dom0 to be sync-ed */
+ while ( test_bit(_VPF_need_sync, &v->pause_flags) )
+ cpu_relax();
+
+ pmprintk(XENLOG_INFO, "vcpu0/dom0 has been paused\n");
+
+ /* now safe to suspend whole system from cpu 0 */
+ regs = &v->arch.guest_context.user_regs;
+ regs->eax = enter_state(acpi_sinfo.sleep_state);
+
+ /* N...