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 1/2] qem-xen: add later wakeup logic when qemu wakeup
Date: Sun, 1 Sep 2013 09:51:24 +0000	[thread overview]
Message-ID: <DE8DF0795D48FD4CA783C40EC829233501348C60__28408.7126412944$1378029218$gmane$org@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <5220B3A3.4000100@citrix.com>

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

>From 86ad3bb83a984ad7bbc00b81d6a0bfc1abc543ca Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Sun, 1 Sep 2013 23:39:14 +0800
Subject: [PATCH 1/2] qemu-xen: add later wakeup logic when qemu wakeup

Currently HVM S3 has a bug coming from the difference between
qemu-traditioanl and qemu-xen. For qemu-traditional, the way
to resume from hvm s3 is via 'xl trigger' command. However,
for qemu-xen, the way to resume from hvm s3 inherited from
standard qemu, i.e. via QMP, and it doesn't work under Xen.

The root cause is, for qemu-xen, 'xl trigger' command didn't reset
devices, while QMP didn't unpause hvm domain though they did qemu
system reset.

We have two qemu-xen patches and one xl patch to fix the HVM S3 bug.
This patch is the qemu-xen patch 1. It provides a later wakeup notifier
and a register function, and notifies the later wakeup list when
qemu wakup by 'xl trigger' command.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 sysemu.h |    1 +
 vl.c     |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/sysemu.h b/sysemu.h
index b71f244..4dbcab7 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -49,6 +49,7 @@ void qemu_register_suspend_notifier(Notifier *notifier);
 void qemu_system_wakeup_request(WakeupReason reason);
 void qemu_system_wakeup_enable(WakeupReason reason, bool enabled);
 void qemu_register_wakeup_notifier(Notifier *notifier);
+void qemu_register_later_wakeup_notifier(Notifier *notifier);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
 void qemu_register_powerdown_notifier(Notifier *notifier);
diff --git a/vl.c b/vl.c
index 5314f55..1c4842d 100644
--- a/vl.c
+++ b/vl.c
@@ -1478,6 +1478,8 @@ static NotifierList suspend_notifiers =
     NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
 static NotifierList wakeup_notifiers =
     NOTIFIER_LIST_INITIALIZER(wakeup_notifiers);
+static NotifierList later_wakeup_notifiers =
+    NOTIFIER_LIST_INITIALIZER(later_wakeup_notifiers);
 static uint32_t wakeup_reason_mask = ~0;
 static RunState vmstop_requested = RUN_STATE_MAX;
 
@@ -1668,6 +1670,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier)
     notifier_list_add(&wakeup_notifiers, notifier);
 }
 
+void qemu_register_later_wakeup_notifier(Notifier *notifier)
+{
+    notifier_list_add(&later_wakeup_notifiers, notifier);
+}
+
 void qemu_system_killed(int signal, pid_t pid)
 {
     shutdown_signal = signal;
@@ -1744,6 +1751,7 @@ static bool main_loop_should_exit(void)
         cpu_synchronize_all_states();
         qemu_system_reset(VMRESET_SILENT);
         resume_all_vcpus();
+        notifier_list_notify(&later_wakeup_notifiers, NULL);
         monitor_protocol_event(QEVENT_WAKEUP, NULL);
     }
     if (qemu_powerdown_requested()) {
-- 
1.7.1

[-- Attachment #2: 0001-Add-later-wakeup-logic-when-qemu-wakeup.patch --]
[-- Type: application/octet-stream, Size: 2752 bytes --]

From 86ad3bb83a984ad7bbc00b81d6a0bfc1abc543ca Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Sun, 1 Sep 2013 23:39:14 +0800
Subject: [PATCH 1/2] Add later wakeup logic when qemu wakeup

Currently HVM S3 has a bug coming from the difference between
qemu-traditioanl and qemu-xen. For qemu-traditional, the way
to resume from hvm s3 is via 'xl trigger' command. However,
for qemu-xen, the way to resume from hvm s3 inherited from
standard qemu, i.e. via QMP, and it doesn't work under Xen.

The root cause is, for qemu-xen, 'xl trigger' command didn't reset
devices, while QMP didn't unpause hvm domain though they did qemu
system reset.

We have two qemu patches and one xl patch to fix the HVM S3 bug.
This patch is the qemu patch 1. It provides a later wakeup notifier
and a register function, and notifies the later wakeup list when
qemu wakup.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 sysemu.h |    1 +
 vl.c     |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/sysemu.h b/sysemu.h
index b71f244..4dbcab7 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -49,6 +49,7 @@ void qemu_register_suspend_notifier(Notifier *notifier);
 void qemu_system_wakeup_request(WakeupReason reason);
 void qemu_system_wakeup_enable(WakeupReason reason, bool enabled);
 void qemu_register_wakeup_notifier(Notifier *notifier);
+void qemu_register_later_wakeup_notifier(Notifier *notifier);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
 void qemu_register_powerdown_notifier(Notifier *notifier);
diff --git a/vl.c b/vl.c
index 5314f55..1c4842d 100644
--- a/vl.c
+++ b/vl.c
@@ -1478,6 +1478,8 @@ static NotifierList suspend_notifiers =
     NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
 static NotifierList wakeup_notifiers =
     NOTIFIER_LIST_INITIALIZER(wakeup_notifiers);
+static NotifierList later_wakeup_notifiers =
+    NOTIFIER_LIST_INITIALIZER(later_wakeup_notifiers);
 static uint32_t wakeup_reason_mask = ~0;
 static RunState vmstop_requested = RUN_STATE_MAX;
 
@@ -1668,6 +1670,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier)
     notifier_list_add(&wakeup_notifiers, notifier);
 }
 
+void qemu_register_later_wakeup_notifier(Notifier *notifier)
+{
+    notifier_list_add(&later_wakeup_notifiers, notifier);
+}
+
 void qemu_system_killed(int signal, pid_t pid)
 {
     shutdown_signal = signal;
@@ -1744,6 +1751,7 @@ static bool main_loop_should_exit(void)
         cpu_synchronize_all_states();
         qemu_system_reset(VMRESET_SILENT);
         resume_all_vcpus();
+        notifier_list_notify(&later_wakeup_notifiers, NULL);
         monitor_protocol_event(QEVENT_WAKEUP, NULL);
     }
     if (qemu_powerdown_requested()) {
-- 
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:51 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 [this message]
2013-09-01  9:54   ` [PATCH 2/2] qemu-xen: add qemu xen logic for HVM S3 resume Liu, Jinsong
2013-09-01  9:54   ` [Qemu-devel] " 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='DE8DF0795D48FD4CA783C40EC829233501348C60__28408.7126412944$1378029218$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.