All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liu, Jinsong" <jinsong.liu@intel.com>
To: Anthony PERARD <anthony.perard@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [PATCH 2/2] qemu-xen: add qemu xen logic for HVM S3 resume
Date: Sun, 1 Sep 2013 09:54:02 +0000	[thread overview]
Message-ID: <DE8DF0795D48FD4CA783C40EC829233501348C81__32000.9529860274$1378029384$gmane$org@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <5220B3A3.4000100@citrix.com>

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

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

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

From e7d4bd70eae8da131dc3ff2cec70cb2c7b6575a9 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Mon, 2 Sep 2013 00:39:20 +0800
Subject: [PATCH 2/2] Add qemu xen logic for HVM S3 resume

This patch is qemu 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 <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 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,
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-09-01  9:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29  8:25 [Qemu-devel] [PATCH V2] qemu-xen: HVM domain S3 bugfix Liu, Jinsong
2013-08-30 15:00 ` Anthony PERARD
2013-09-01  9:51   ` [Qemu-devel] [PATCH 1/2] qem-xen: add later wakeup logic when qemu wakeup Liu, Jinsong
2013-09-03 10:55     ` Anthony PERARD
2013-09-03 11:04       ` Liu, Jinsong
2013-09-03 11:04       ` [Qemu-devel] " Liu, Jinsong
2013-09-05 17:27         ` Stefano Stabellini
2013-09-05 17:27         ` [Qemu-devel] " Stefano Stabellini
2013-09-06  9:03           ` Liu, Jinsong
2013-09-06  9:03           ` [Qemu-devel] " Liu, Jinsong
2013-09-03 10:55     ` Anthony PERARD
2013-09-01  9:51   ` Liu, Jinsong
2013-09-01  9:54   ` Liu, Jinsong [this message]
2013-09-01  9:54   ` [Qemu-devel] [PATCH 2/2] qemu-xen: add qemu xen logic for HVM S3 resume Liu, Jinsong
2013-09-03 10:56     ` Anthony PERARD
2013-09-03 10:56     ` Anthony PERARD
2013-09-01  9:58   ` [PATCH V2] qemu-xen: HVM domain S3 bugfix Liu, Jinsong
2013-09-01  9:58   ` [Qemu-devel] " Liu, Jinsong
2013-08-30 15:00 ` Anthony PERARD
2013-09-05 19:57 ` Paolo Bonzini
2013-09-05 19:57 ` [Qemu-devel] " Paolo Bonzini
2013-09-09  3:24   ` Liu, Jinsong
2013-09-09  3:24   ` Liu, Jinsong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='DE8DF0795D48FD4CA783C40EC829233501348C81__32000.9529860274$1378029384$gmane$org@SHSMSX101.ccr.corp.intel.com' \
    --to=jinsong.liu@intel.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.