This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Suspend/Save a machine under HVM (questions for implementati

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Suspend/Save a machine under HVM (questions for implementation in Win GPL PV driveres)
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2008 22:27:30 +1100
Delivery-date: Tue, 26 Feb 2008 03:27:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ach4apKHkUpEJOpWRqWSpFVSBjrRzA==
Thread-topic: Suspend/Save a machine under HVM (questions for implementation in Win GPL PV driveres)
Are there any documents describing how an 'xm save' should work under
HVM? I would like to add this functionality to the Windows GPL PV

Starting with the 'unmodified drivers' code for Linux, I think it goes
something like this (ignoring the failure or cancelled path for now):

. Dom0 writes 'suspend' to 'shutdown' in xenstore
. DomU agrees to the suspend by doing ?
. DomU suspends each device
  . This appears to almost be a no-op for vbd and vif?
. DomU suspends xenbus
  . Again, this pretty much looks like a no-op
. DomU calls preempt_disable()
. DomU disables the HVM IRQ
. DomU waits until all CPU's are idling
. DomU disables all IRQs on the local CPU
. DomU calls HYPERVISOR_shutdown with an argument of SHUTDOWN_suspend

At this point the machine is suspended. Resume is the reversal of
suspend, with the following exceptions:
. vbd just re-issues all the outstanding requests to the backend *1
. vif just tells the operating system that all outstanding requests were
successful? Or maybe that they failed? I can't exactly find this in the
code, but I'm guessing that that is probably okay. Either that or we
re-send them, but if the duration of the suspend is anything other than
very short the packets are no longer valid anyway

*1 what happens if the outstanding requests were:
A - Read value from sector 42
B - Write value X to sector 42
C - Read value from sector 42

If all the requests had been completed by the backend but not yet
processed on the frontend, then when the operations are retransmitted,
operation A is going to return the value of X, instead of whatever was
previously in sector 42. Maybe this doesn't matter...


Xen-devel mailing list