From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQDf-0003FH-KG for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:51:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJQDb-00019P-8S for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:51:11 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:31649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJQDb-00019B-3A for qemu-devel@nongnu.org; Tue, 10 Sep 2013 11:51:07 -0400 Message-ID: <522F3FDA.2050702@citrix.com> Date: Tue, 10 Sep 2013 16:50:50 +0100 From: Anthony PERARD MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Liu, Jinsong" Cc: Ian Campbell , Stefano Stabellini , George Dunlap , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" , Paolo Bonzini On 09/09/13 04:28, Liu, Jinsong wrote: > From 63668de43b6512c1db06405b0d2d1e0a0c68244b Mon Sep 17 00:00:00 2001 > From: Liu Jinsong > Date: Sun, 8 Sep 2013 00:39:45 +0800 > Subject: [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume > > This patch is qemu patch 2 to fix Xen HVM S3 bug, adding qemu > xen logic. When qemu wakeup, qemu xen logic is notified and > hypercall to xen hypervisor to unpause domain. > > Signed-off-by: Liu Jinsong > --- > xen-all.c | 9 +++++++++ > 1 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/xen-all.c b/xen-all.c > index eb13111..388d311 100644 > --- a/xen-all.c > +++ b/xen-all.c > @@ -98,6 +98,7 @@ typedef struct XenIOState { > > Notifier exit; > Notifier suspend; > + Notifier wakeup; > } XenIOState; > > /* Xen specific function for piix pci */ > @@ -1059,6 +1060,11 @@ static void xen_read_physmap(XenIOState *state) > free(entries); > } > > +static void xen_wakeup_notifier(Notifier *notifier, void *data) > +{ > + xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 0); > +} > + > int xen_hvm_init(void) > { > int i, rc; > @@ -1088,6 +1094,9 @@ int xen_hvm_init(void) > state->suspend.notify = xen_suspend_notifier; > qemu_register_suspend_notifier(&state->suspend); > > + state->wakeup.notify = xen_wakeup_notifier; > + qemu_register_wakeup_notifier(&state->wakeup); > + > xc_get_hvm_param(xen_xc, xen_domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn); > DPRINTF("shared page at pfn %lx\n", ioreq_pfn); > state->shared_page = xc_map_foreign_range(xen_xc, xen_domid, XC_PAGE_SIZE, > Reviewed-by: Anthony PERARD -- Anthony PERARD