qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Luis <miguel.luis@oracle.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	Igor Mammedov <imammedo@redhat.com>,
	"dave@treblig.org" <dave@treblig.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"anisinha@redhat.com" <anisinha@redhat.com>,
	"shannon.zhaosl@gmail.com" <shannon.zhaosl@gmail.com>,
	"eduardo@habkost.net" <eduardo@habkost.net>,
	"marcel.apfelbaum@gmail.com" <marcel.apfelbaum@gmail.com>,
	"philmd@linaro.org" <philmd@linaro.org>,
	"wangyanan55@huawei.com" <wangyanan55@huawei.com>,
	"zhao1.liu@intel.com" <zhao1.liu@intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"richard.henderson@linaro.org" <richard.henderson@linaro.org>,
	"eblake@redhat.com" <eblake@redhat.com>,
	"armbru@redhat.com" <armbru@redhat.com>,
	Annie Li <annie.li@oracle.com>
Subject: Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support
Date: Thu, 10 Oct 2024 12:43:23 +0000	[thread overview]
Message-ID: <5A3324A3-666C-435D-B8BA-ACDF770DA66A@oracle.com> (raw)
In-Reply-To: <CAFEAcA_Hnc84gKDnJgq6jbjNegJVcJUUAqTuSp99fvqoekBJSA@mail.gmail.com>

Hi Peter,

> On 8 Oct 2024, at 11:53, Peter Maydell <peter.maydell@linaro.org> wrote:
> 
> On Fri, 27 Sept 2024 at 19:40, Annie Li <annie.li@oracle.com> wrote:
>> 
>> From: Miguel Luis <miguel.luis@oracle.com>
>> 
>> For reference: qmp_system_sleep relies on wakeup support delegated
>> by qemu_wakeup_suspend_enabled() hence the need for calling
>> qemu_register_wakeup_support(). With this, we should be able to
>> issue QMP system_sleep command now.
>> 
>> Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
>> ---
>> hw/arm/virt.c | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 6be80f042f..370ee4fe7f 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -2403,6 +2403,7 @@ static void machvirt_init(MachineState *machine)
>> 
>>      /* connect sleep request */
>>      vms->sleep_notifier.notify = virt_sleep_req;
>> +     qemu_register_wakeup_support();
> 
> On i386 the machine has a MachineClass::wakeup method
> (pc_machine_wakeup) that does things on wakeup.
> 
> On ppc/spapr there is this comment before the call
> to qemu_register_wakeup_support():
>    /*
>     * Nothing needs to be done to resume a suspended guest because
>     * suspending does not change the machine state, so no need for
>     * a ->wakeup method.
>     */
> 
> I think that for Arm we need to determine whether the virt
> board is like i386/pc (need to do something on wakeup) or
> like ppc/spapr (don't need to do anything on wakeup). If the
> former, we obviously would need to implement the
> MachineClass::wakeup method; if the latter, then we
> should have a comment explaining why there doesn't need
> to be any action taken on resume and therefore the machine
> has no wakeup method.
> 

I believe it will be needed to reset the cpus and restore context afterwards but
before that I’m yet still to find a reliable wakeup source for the
experiments.

So far I’ve tried the rtc-efi wakeup source but it seems not supporting time in
the future in wakealarm so there’s still pending research on this. 

Direction hints for acceptable ways forward are always welcome, of course.
Many thanks for that.

Miguel

> thanks
> -- PMM



  reply	other threads:[~2024-10-10 12:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
2024-10-07 12:44   ` Igor Mammedov
2024-10-08 15:21     ` Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Annie Li
2024-10-07 12:59   ` Igor Mammedov
2024-10-08 15:22     ` Annie Li
2024-10-11 12:10       ` Igor Mammedov
2024-09-27 18:38 ` [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Annie Li
2024-10-07 13:32   ` Igor Mammedov
2024-10-08 15:33     ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86 Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 09/11] hw/arm: enable sleep support " Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 11/11] arm/virt: enable sleep support Annie Li
2024-10-08 11:53   ` Peter Maydell
2024-10-10 12:43     ` Miguel Luis [this message]
2024-10-07 13:41 ` [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Igor Mammedov
2024-10-08 15:21   ` Annie Li

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=5A3324A3-666C-435D-B8BA-ACDF770DA66A@oracle.com \
    --to=miguel.luis@oracle.com \
    --cc=anisinha@redhat.com \
    --cc=annie.li@oracle.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /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).