qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume
@ 2013-09-09  3:28 Liu, Jinsong
  2013-09-10 15:50 ` Anthony PERARD
  0 siblings, 1 reply; 2+ messages in thread
From: Liu, Jinsong @ 2013-09-09  3:28 UTC (permalink / raw)
  To: Paolo Bonzini, Anthony PERARD, Stefano Stabellini
  Cc: George Dunlap, qemu-devel@nongnu.org, Ian Campbell,
	xen-devel@lists.xen.org

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

>From 63668de43b6512c1db06405b0d2d1e0a0c68244b Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
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 <jinsong.liu@intel.com>
---
 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,
-- 
1.7.1

[-- Attachment #2: 0002-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch --]
[-- Type: application/octet-stream, Size: 1601 bytes --]

From 63668de43b6512c1db06405b0d2d1e0a0c68244b Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
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 <jinsong.liu@intel.com>
---
 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,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume
  2013-09-09  3:28 [Qemu-devel] [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume Liu, Jinsong
@ 2013-09-10 15:50 ` Anthony PERARD
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony PERARD @ 2013-09-10 15:50 UTC (permalink / raw)
  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 <jinsong.liu@intel.com>
> 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 <jinsong.liu@intel.com>
> ---
>  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@citrix.com>

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-10 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09  3:28 [Qemu-devel] [PATCH V3 2/2] qemu: Add qemu xen logic for Xen HVM S3 resume Liu, Jinsong
2013-09-10 15:50 ` Anthony PERARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).