xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] Qemu-xen: HVM S3 bugfix
Date: Tue, 20 Aug 2013 15:40:34 +0100	[thread overview]
Message-ID: <52137FE2.8050906@citrix.com> (raw)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC829233501334B1B@SHSMSX101.ccr.corp.intel.com>

On 13/08/13 15:15, Liu, Jinsong wrote:
> From fc928436df17673bfea1d902859c682c99c1489d Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@intel.com>
> Date: Wed, 14 Aug 2013 05:26:56 +0800
> Subject: [PATCH] Qemu-xen: HVM S3 bugfix
> 
> This patch is used to fix HVM S3 bug caused from the difference
> between qemu-traditioanl and standard qemu (which qemu-xen stems from).
> For qemu-traditional, hvm s3 resumes via 'xl trigger' command interface.
> For standard qemu, hvm s3 resumes via keyboard triggering.
> 
> So currently for qemu-xen, both 'xl' interface and keyboard triggering
> hvm s3 cannot work. 'xl' interface didn't reset ioemu devices, while
> keyboard triggering didn't unpause hvm domain.
> 
> This patch fixes the bug. It keeps compatible w/ current xen 'xl' interface,
> by moving qemu system reset logic forward to qemu suspend.
> 
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  vl.c |   25 ++++++++++++++++---------
>  1 files changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 5314f55..deea92c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1619,10 +1619,15 @@ void qemu_system_reset_request(void)
>  
>  static void qemu_system_suspend(void)
>  {
> -    pause_all_vcpus();
> -    notifier_list_notify(&suspend_notifiers, NULL);
> -    runstate_set(RUN_STATE_SUSPENDED);
> -    monitor_protocol_event(QEVENT_SUSPEND, NULL);
> +    if (!xen_enabled()) {
> +        pause_all_vcpus();
> +        notifier_list_notify(&suspend_notifiers, NULL);
> +        runstate_set(RUN_STATE_SUSPENDED);
> +        monitor_protocol_event(QEVENT_SUSPEND, NULL);
> +    } else {
> +        notifier_list_notify(&suspend_notifiers, NULL);
> +        qemu_system_reset(VMRESET_SILENT);
> +    }
>  }
>  
>  void qemu_system_suspend_request(void)
> @@ -1740,11 +1745,13 @@ static bool main_loop_should_exit(void)
>          }
>      }
>      if (qemu_wakeup_requested()) {
> -        pause_all_vcpus();
> -        cpu_synchronize_all_states();
> -        qemu_system_reset(VMRESET_SILENT);
> -        resume_all_vcpus();
> -        monitor_protocol_event(QEVENT_WAKEUP, NULL);
> +        if (!xen_enabled()) {
> +            pause_all_vcpus();
> +            cpu_synchronize_all_states();
> +            qemu_system_reset(VMRESET_SILENT);
> +            resume_all_vcpus();
> +            monitor_protocol_event(QEVENT_WAKEUP, NULL);
> +        }
>      }
>      if (qemu_powerdown_requested()) {
>          qemu_system_powerdown();

Hi,

I don't think changing vl.c is a good idee for this.

Could you try to use a QMP command instead ? Look for the QMP command
"system_wakeup", it's probably what's needed to be called on qemu-xen.

A simple way to test this would be to call the QMP command manually with
QMP/qmp present in the qemu tree.
$ ./QMP/qmp --path=/run/xen/qmp-libxl-$domid system_wakeup

-- 
Anthony PERARD

  parent reply	other threads:[~2013-08-20 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 14:15 [PATCH] Qemu-xen: HVM S3 bugfix Liu, Jinsong
2013-08-19 14:47 ` Liu, Jinsong
     [not found] ` <DE8DF0795D48FD4CA783C40EC82923350133997B@SHSMSX101.ccr.corp.intel.com>
2013-08-20  9:12   ` George Dunlap
2013-08-20 14:40 ` Anthony PERARD [this message]
2013-08-23  8:37   ` 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=52137FE2.8050906@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=jinsong.liu@intel.com \
    --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 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).