From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [PATCH 2/2] qemu-xen: add qemu xen logic for HVM S3 resume Date: Tue, 3 Sep 2013 11:56:28 +0100 Message-ID: <5225C05C.8080403__30150.3568808132$1378205903$gmane$org@citrix.com> References: <5220B3A3.4000100@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Liu, Jinsong" Cc: George Dunlap , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 01/09/13 10:54, Liu, Jinsong wrote: > From e7d4bd70eae8da131dc3ff2cec70cb2c7b6575a9 Mon Sep 17 00:00:00 2001 > From: Liu Jinsong > Date: Mon, 2 Sep 2013 00:39:20 +0800 > Subject: [PATCH 2/2] qemu-xen: add qemu xen logic for HVM S3 resume > > This patch is qemu-xen patch 2 to fix 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 15be8ed..bef946b 100644 > --- a/xen-all.c > +++ b/xen-all.c > @@ -97,6 +97,7 @@ typedef struct XenIOState { > > Notifier exit; > Notifier suspend; > + Notifier later_wakeup; > } XenIOState; > > /* Xen specific function for piix pci */ > @@ -139,6 +140,11 @@ static void xen_suspend_notifier(Notifier *notifier, void *data) > xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 3); > } > > +static void xen_later_wakeup_notifier(Notifier *notifier, void *data) > +{ > + xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 0); > +} > + > /* Xen Interrupt Controller */ > > static void xen_set_irq(void *opaque, int irq, int level) > @@ -1106,6 +1112,9 @@ int xen_hvm_init(void) > state->suspend.notify = xen_suspend_notifier; > qemu_register_suspend_notifier(&state->suspend); > > + state->later_wakeup.notify = xen_later_wakeup_notifier; > + qemu_register_later_wakeup_notifier(&state->later_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, > Acked-by: Anthony PERARD -- Anthony PERARD