From: David Gibson <david@gibson.dropbear.id.au>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: "Liu, Jinsong" <jinsong.liu@intel.com>,
Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
qemu-ppc@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] i386: use machine class ->wakeup method
Date: Mon, 22 Jul 2019 18:38:55 +1000 [thread overview]
Message-ID: <20190722083855.GE25073@umbus.fritz.box> (raw)
In-Reply-To: <20190722061752.22114-1-npiggin@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]
On Mon, Jul 22, 2019 at 04:17:51PM +1000, Nicholas Piggin wrote:
> Move the i386 suspend_wakeup logic out of the fallback path, and into
> the new ->wakeup method.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/i386/pc.c | 8 ++++++++
> vl.c | 2 --
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 549c437050..78c03d7f9d 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2828,6 +2828,13 @@ static void pc_machine_reset(MachineState *machine)
> }
> }
>
> +static void pc_machine_wakeup(MachineState *machine)
> +{
> + cpu_synchronize_all_states();
> + pc_machine_reset(machine);
> + cpu_synchronize_all_post_reset();
> +}
> +
> static CpuInstanceProperties
> pc_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
> {
> @@ -2940,6 +2947,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
> mc->block_default_type = IF_IDE;
> mc->max_cpus = 255;
> mc->reset = pc_machine_reset;
> + mc->wakeup = pc_machine_wakeup;
> hc->pre_plug = pc_machine_device_pre_plug_cb;
> hc->plug = pc_machine_device_plug_cb;
> hc->unplug_request = pc_machine_device_unplug_request_cb;
> diff --git a/vl.c b/vl.c
> index 45ea034410..3f50dd685b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1567,8 +1567,6 @@ static void qemu_system_wakeup(void)
>
> if (mc && mc->wakeup) {
> mc->wakeup(current_machine);
> - } else {
> - qemu_system_reset(SHUTDOWN_CAUSE_NONE);
> }
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-07-22 10:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 6:17 [Qemu-devel] [PATCH v2 2/3] i386: use machine class ->wakeup method Nicholas Piggin
2019-07-22 6:17 ` [Qemu-devel] [PATCH v2 3/3] spapr: Implement ibm,suspend-me Nicholas Piggin
2019-07-22 8:39 ` David Gibson
2019-07-22 8:38 ` David Gibson [this message]
2019-07-22 11:19 ` [Qemu-devel] [PATCH v2 2/3] i386: use machine class ->wakeup method Paolo Bonzini
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=20190722083855.GE25073@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=ehabkost@redhat.com \
--cc=jinsong.liu@intel.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mst@redhat.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/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).