[PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm

Jiaxun Yang posted 3 patches 1 year, 6 months ago
hw/acpi/generic_event_device.c         | 70 ++++++++++++++++++++++++++++++----
hw/i386/acpi-microvm.c                 | 18 +++++++++
hw/i386/microvm.c                      |  3 ++
hw/loongarch/acpi-build.c              | 18 +++++++++
hw/loongarch/virt.c                    |  3 ++
include/hw/acpi/generic_event_device.h | 12 +++++-
6 files changed, 115 insertions(+), 9 deletions(-)
[PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by Jiaxun Yang 1 year, 6 months ago
Hi all,

This series implemented S3 and S4 sleep for loongarch virt machine
and microvm.

For loongarch/virt a kernel patch is requried [1].

[1]: https://lore.kernel.org/loongarch/20240613-loongarch64-sleep-v1-0-a245232af5e4@flygoat.com/

Please review.
Thanks

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
Jiaxun Yang (3):
      acpi/ged: Implement S3 and S4 sleep
      hw/loongarch/virt: Wire up S3 and S4 sleep
      hw/i386/microvm: Wire up S3 and S4 sleep

 hw/acpi/generic_event_device.c         | 70 ++++++++++++++++++++++++++++++----
 hw/i386/acpi-microvm.c                 | 18 +++++++++
 hw/i386/microvm.c                      |  3 ++
 hw/loongarch/acpi-build.c              | 18 +++++++++
 hw/loongarch/virt.c                    |  3 ++
 include/hw/acpi/generic_event_device.h | 12 +++++-
 6 files changed, 115 insertions(+), 9 deletions(-)
---
base-commit: f3e8cc47de2bc537d4991e883a85208e4e1c0f98
change-id: 20240613-loongarch64-sleep-37b2466b8d76

Best regards,
-- 
Jiaxun Yang <jiaxun.yang@flygoat.com>
Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by maobibo 1 year, 6 months ago
It is interesting.

How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or 
ethernet magic packet or qemu monitor command in background?

Regards
Bibo Mao


On 2024/6/14 上午1:30, Jiaxun Yang wrote:
> Hi all,
> 
> This series implemented S3 and S4 sleep for loongarch virt machine
> and microvm.
> 
> For loongarch/virt a kernel patch is requried [1].
> 
> [1]: https://lore.kernel.org/loongarch/20240613-loongarch64-sleep-v1-0-a245232af5e4@flygoat.com/
> 
> Please review.
> Thanks
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> Jiaxun Yang (3):
>        acpi/ged: Implement S3 and S4 sleep
>        hw/loongarch/virt: Wire up S3 and S4 sleep
>        hw/i386/microvm: Wire up S3 and S4 sleep
> 
>   hw/acpi/generic_event_device.c         | 70 ++++++++++++++++++++++++++++++----
>   hw/i386/acpi-microvm.c                 | 18 +++++++++
>   hw/i386/microvm.c                      |  3 ++
>   hw/loongarch/acpi-build.c              | 18 +++++++++
>   hw/loongarch/virt.c                    |  3 ++
>   include/hw/acpi/generic_event_device.h | 12 +++++-
>   6 files changed, 115 insertions(+), 9 deletions(-)
> ---
> base-commit: f3e8cc47de2bc537d4991e883a85208e4e1c0f98
> change-id: 20240613-loongarch64-sleep-37b2466b8d76
> 
> Best regards,
> 


Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by Jiaxun Yang 1 year, 6 months ago

在2024年6月14日六月 上午4:32,maobibo写道:
> It is interesting.
>
> How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or 
> ethernet magic packet or qemu monitor command in background?

Hi Bibo,

The best way to wake the guest is system_wakeup command in monitor.

Thanks
- Jiaxun

>
> Regards
> Bibo Mao
>
>
> On 2024/6/14 上午1:30, Jiaxun Yang wrote:
>> Hi all,
>> 
>> This series implemented S3 and S4 sleep for loongarch virt machine
>> and microvm.
>> 
>> For loongarch/virt a kernel patch is requried [1].
>> 
>> [1]: https://lore.kernel.org/loongarch/20240613-loongarch64-sleep-v1-0-a245232af5e4@flygoat.com/
>> 
>> Please review.
>> Thanks
>> 
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> Jiaxun Yang (3):
>>        acpi/ged: Implement S3 and S4 sleep
>>        hw/loongarch/virt: Wire up S3 and S4 sleep
>>        hw/i386/microvm: Wire up S3 and S4 sleep
>> 
>>   hw/acpi/generic_event_device.c         | 70 ++++++++++++++++++++++++++++++----
>>   hw/i386/acpi-microvm.c                 | 18 +++++++++
>>   hw/i386/microvm.c                      |  3 ++
>>   hw/loongarch/acpi-build.c              | 18 +++++++++
>>   hw/loongarch/virt.c                    |  3 ++
>>   include/hw/acpi/generic_event_device.h | 12 +++++-
>>   6 files changed, 115 insertions(+), 9 deletions(-)
>> ---
>> base-commit: f3e8cc47de2bc537d4991e883a85208e4e1c0f98
>> change-id: 20240613-loongarch64-sleep-37b2466b8d76
>> 
>> Best regards,
>>

-- 
- Jiaxun
Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by maobibo 1 year, 6 months ago

On 2024/6/14 下午12:27, Jiaxun Yang wrote:
> 
> 
> 在2024年6月14日六月 上午4:32,maobibo写道:
>> It is interesting.
>>
>> How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or
>> ethernet magic packet or qemu monitor command in background?
> 
> Hi Bibo,
> 
> The best way to wake the guest is system_wakeup command in monitor.
Ok, I see.

It is useful and it can be used to test S3/S4 in TCG mode at least.

Can we add feature capability, enabled in TCG mode, disabled in KVM mode 
by default? If vm deploys in cloud, users in general help it is power-on 
always.

Regards
Bibo Mao
> 
> Thanks
> - Jiaxun
> 
>>
>> Regards
>> Bibo Mao
>>
>>
>> On 2024/6/14 上午1:30, Jiaxun Yang wrote:
>>> Hi all,
>>>
>>> This series implemented S3 and S4 sleep for loongarch virt machine
>>> and microvm.
>>>
>>> For loongarch/virt a kernel patch is requried [1].
>>>
>>> [1]: https://lore.kernel.org/loongarch/20240613-loongarch64-sleep-v1-0-a245232af5e4@flygoat.com/
>>>
>>> Please review.
>>> Thanks
>>>
>>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>>> ---
>>> Jiaxun Yang (3):
>>>         acpi/ged: Implement S3 and S4 sleep
>>>         hw/loongarch/virt: Wire up S3 and S4 sleep
>>>         hw/i386/microvm: Wire up S3 and S4 sleep
>>>
>>>    hw/acpi/generic_event_device.c         | 70 ++++++++++++++++++++++++++++++----
>>>    hw/i386/acpi-microvm.c                 | 18 +++++++++
>>>    hw/i386/microvm.c                      |  3 ++
>>>    hw/loongarch/acpi-build.c              | 18 +++++++++
>>>    hw/loongarch/virt.c                    |  3 ++
>>>    include/hw/acpi/generic_event_device.h | 12 +++++-
>>>    6 files changed, 115 insertions(+), 9 deletions(-)
>>> ---
>>> base-commit: f3e8cc47de2bc537d4991e883a85208e4e1c0f98
>>> change-id: 20240613-loongarch64-sleep-37b2466b8d76
>>>
>>> Best regards,
>>>
> 


Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by Daniel P. Berrangé 1 year, 6 months ago
On Fri, Jun 14, 2024 at 01:17:39PM +0800, maobibo wrote:
> 
> 
> On 2024/6/14 下午12:27, Jiaxun Yang wrote:
> > 
> > 
> > 在2024年6月14日六月 上午4:32,maobibo写道:
> > > It is interesting.
> > > 
> > > How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or
> > > ethernet magic packet or qemu monitor command in background?
> > 
> > Hi Bibo,
> > 
> > The best way to wake the guest is system_wakeup command in monitor.
> Ok, I see.
> 
> It is useful and it can be used to test S3/S4 in TCG mode at least.
> 
> Can we add feature capability, enabled in TCG mode, disabled in KVM mode by
> default? If vm deploys in cloud, users in general help it is power-on
> always.

Please avoid creating differing defaults between TCG and KVM where
practical.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by maobibo 1 year, 6 months ago

On 2024/6/14 下午10:03, Daniel P. Berrangé wrote:
> On Fri, Jun 14, 2024 at 01:17:39PM +0800, maobibo wrote:
>>
>>
>> On 2024/6/14 下午12:27, Jiaxun Yang wrote:
>>>
>>>
>>> 在2024年6月14日六月 上午4:32,maobibo写道:
>>>> It is interesting.
>>>>
>>>> How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or
>>>> ethernet magic packet or qemu monitor command in background?
>>>
>>> Hi Bibo,
>>>
>>> The best way to wake the guest is system_wakeup command in monitor.
>> Ok, I see.
>>
>> It is useful and it can be used to test S3/S4 in TCG mode at least.
>>
>> Can we add feature capability, enabled in TCG mode, disabled in KVM mode by
>> default? If vm deploys in cloud, users in general help it is power-on
>> always.
> 
> Please avoid creating differing defaults between TCG and KVM where
> practical.
There is bad experience for me, remote VM suddenly freezes and all 
network connection are lost if virt-machine does not support S3/S4 on 
LoongArch machines.

However it does not happen on x86 machine, how does x86 KVM VM machine 
stop this?

Regards
Bibo Mao
> 
> With regards,
> Daniel
> 


Re: [PATCH 0/3] S3 and S4 sleep for loongarch/virt & microvm
Posted by Jiaxun Yang 1 year, 6 months ago

在2024年6月14日六月 上午6:17,maobibo写道:
> On 2024/6/14 下午12:27, Jiaxun Yang wrote:
>> 
>> 
>> 在2024年6月14日六月 上午4:32,maobibo写道:
>>> It is interesting.
>>>
>>> How to wakeup VM if it sleeps in S3/S4, from emulated keyboard or
>>> ethernet magic packet or qemu monitor command in background?
>> 
>> Hi Bibo,
>> 
>> The best way to wake the guest is system_wakeup command in monitor.
> Ok, I see.
>
> It is useful and it can be used to test S3/S4 in TCG mode at least.
>
> Can we add feature capability, enabled in TCG mode, disabled in KVM mode 
> by default? If vm deploys in cloud, users in general help it is power-on 
> always.

Well, I think we should align both machines as much as possible.

It's also enabled for KVM on x86 piix4 and q35 machines.

Thanks
>
> Regards
> Bibo Mao
-- 
- Jiaxun