[PATCH 12/13] microvm: enable suspend

Annie Li posted 13 patches 5 months, 3 weeks ago
Maintainers: "Dr. David Alan Gilbert" <dave@treblig.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Sergio Lopez <slp@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
[PATCH 12/13] microvm: enable suspend
Posted by Annie Li 5 months, 3 weeks ago
The function qemu_wakeup_suspend_enabled combines the suspend
and wakeup together. However, the microvm doesn't support
wakeup yet. Suspend is enabled here, but wakeup doesn't
actually work for microvm now.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 hw/i386/microvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index eba33c4365..da5d4126e5 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -489,6 +489,7 @@ static void microvm_machine_state_init(MachineState *machine)
     qemu_add_machine_init_done_notifier(&mms->machine_done);
     mms->powerdown_req.notify = microvm_powerdown_req;
     qemu_register_powerdown_notifier(&mms->powerdown_req);
+    qemu_register_wakeup_support();
 
     microvm_memory_init(mms);
 
-- 
2.43.5
Re: [PATCH 12/13] microvm: enable suspend
Posted by Igor Mammedov 5 months, 2 weeks ago
On Wed, 28 May 2025 12:42:03 -0400
Annie Li <annie.li@oracle.com> wrote:

> The function qemu_wakeup_suspend_enabled combines the suspend
> and wakeup together. However, the microvm doesn't support
> wakeup yet. Suspend is enabled here, but wakeup doesn't
> actually work for microvm now.

why wakeup doesn't work?

> 
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>  hw/i386/microvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index eba33c4365..da5d4126e5 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -489,6 +489,7 @@ static void microvm_machine_state_init(MachineState *machine)
>      qemu_add_machine_init_done_notifier(&mms->machine_done);
>      mms->powerdown_req.notify = microvm_powerdown_req;
>      qemu_register_powerdown_notifier(&mms->powerdown_req);
> +    qemu_register_wakeup_support();
>  
>      microvm_memory_init(mms);
>
Re: [PATCH 12/13] microvm: enable suspend
Posted by Annie Li 5 months, 2 weeks ago
Hi Igor,

On 6/3/2025 9:03 AM, Igor Mammedov wrote:
> On Wed, 28 May 2025 12:42:03 -0400
> Annie Li <annie.li@oracle.com> wrote:
>
>> The function qemu_wakeup_suspend_enabled combines the suspend
>> and wakeup together. However, the microvm doesn't support
>> wakeup yet. Suspend is enabled here, but wakeup doesn't
>> actually work for microvm now.
> why wakeup doesn't work?
Microvm is missing the support for wakeup now, such as, wakeup notifier,
the sleep status needs to be set, etc.
Details are in "Table 4.20: Sleep Status Register" in ACPI spec 6.5.

I've only covered the sleep support for microvm since this patch focuses
on the sleep button.

Thanks

Annie

>
>> Signed-off-by: Annie Li <annie.li@oracle.com>
>> ---
>>   hw/i386/microvm.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
>> index eba33c4365..da5d4126e5 100644
>> --- a/hw/i386/microvm.c
>> +++ b/hw/i386/microvm.c
>> @@ -489,6 +489,7 @@ static void microvm_machine_state_init(MachineState *machine)
>>       qemu_add_machine_init_done_notifier(&mms->machine_done);
>>       mms->powerdown_req.notify = microvm_powerdown_req;
>>       qemu_register_powerdown_notifier(&mms->powerdown_req);
>> +    qemu_register_wakeup_support();
>>   
>>       microvm_memory_init(mms);
>>
Re: [PATCH 12/13] microvm: enable suspend
Posted by Igor Mammedov 3 months ago
On Tue, 3 Jun 2025 15:22:27 -0400
Annie Li <annie.li@oracle.com> wrote:

> Hi Igor,
> 
> On 6/3/2025 9:03 AM, Igor Mammedov wrote:
> > On Wed, 28 May 2025 12:42:03 -0400
> > Annie Li <annie.li@oracle.com> wrote:
> >  
> >> The function qemu_wakeup_suspend_enabled combines the suspend
> >> and wakeup together. However, the microvm doesn't support
> >> wakeup yet. Suspend is enabled here, but wakeup doesn't
> >> actually work for microvm now.  
> > why wakeup doesn't work?  
> Microvm is missing the support for wakeup now, such as, wakeup notifier,
> the sleep status needs to be set, etc.
> Details are in "Table 4.20: Sleep Status Register" in ACPI spec 6.5.

how hard would it be to implement wakeup in microvm?

> I've only covered the sleep support for microvm since this patch focuses
> on the sleep button.
> 
> Thanks
> 
> Annie
> 
> >  
> >> Signed-off-by: Annie Li <annie.li@oracle.com>
> >> ---
> >>   hw/i386/microvm.c | 1 +
> >>   1 file changed, 1 insertion(+)
> >>
> >> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> >> index eba33c4365..da5d4126e5 100644
> >> --- a/hw/i386/microvm.c
> >> +++ b/hw/i386/microvm.c
> >> @@ -489,6 +489,7 @@ static void microvm_machine_state_init(MachineState *machine)
> >>       qemu_add_machine_init_done_notifier(&mms->machine_done);
> >>       mms->powerdown_req.notify = microvm_powerdown_req;
> >>       qemu_register_powerdown_notifier(&mms->powerdown_req);
> >> +    qemu_register_wakeup_support();
> >>   
> >>       microvm_memory_init(mms);
> >>     
>