qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Annie Li <annie.li@oracle.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: miguel.luis@oracle.com, qemu-devel@nongnu.org,
	qemu-arm@nongnu.org, dave@treblig.org, mst@redhat.com,
	anisinha@redhat.com, shannon.zhaosl@gmail.com,
	peter.maydell@linaro.org, eduardo@habkost.net,
	marcel.apfelbaum@gmail.com, philmd@linaro.org,
	wangyanan55@huawei.com, zhao1.liu@intel.com, pbonzini@redhat.com,
	richard.henderson@linaro.org, eblake@redhat.com,
	armbru@redhat.com
Subject: Re: [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button
Date: Tue, 8 Oct 2024 11:21:05 -0400	[thread overview]
Message-ID: <80483b29-2334-46a2-a95c-649d898a1fd6@oracle.com> (raw)
In-Reply-To: <20241007154150.6d406a7b@imammedo.users.ipa.redhat.com>


On 10/7/2024 9:41 AM, Igor Mammedov wrote:
> On Fri, 27 Sep 2024 14:38:55 -0400
> Annie Li <annie.li@oracle.com> wrote:
>
>> The ACPI sleep button can be implemented as a fixed hardware button
>> or Control Method Sleep button.
>>
>> The patch of implementing a fixed hardware sleep button was posted
>> here 1). More discussions can be found here 2). Essentially, the
>> discussion mainly focuses on whether the sleep button is implemented
>> as a fixed hardware button or Control Method Sleep button. The latter
>> benefits various architectures since the code can be shared among
>> them.
>>
>> This patch set implements Control Method Sleep button for both x86
>> and ARM platform.(The patch set was posted previously here 3). We
>> rebase all the patches on QEMU9.1.0 and re-post it).
>>
>> For x86, a sleep button GPE event handler is implemented, so a GPE
>> event is triggered to indicate the OSPM the sleep button is pressed.
>> Tests have been done for Linux guest, and Windows Server guest,
>> the sleep button works as expected.
>>
>> For ARM, a GED event is triggered to notify the OSPM. With proper
>> debug knobs it is possible to see the guest OSPM acknowledges the
>> sleep event:
> Series also missed 'microvm', that uses GED
> (it's likely the same amount of work as for arm/virt board)
I haven't implement this for 'microvm' yet, will work on this part, as 
well as
things you mentioned below.

Thanks
Annie

>
> also test all boards you are touching, to make sure you
> didn't break them.
>
> Note: commit messages should be more verbose explaining why and what
> patches are doing.
>
> PS:
> Also keep  changelog in cover letter, for a short list of changes
> between series revisions,
> see '[PATCH v3 0/1] hw/nvme: add atomic write support' for an example
>
>> (qemu) system_sleep
>> (qemu) [6.744138] exregion-0179 ex_system_memory_space: System-Memory (width 32) R/W 0 Address=0000000009080000
>> [6.746003] evmisc-0132 ev_queue_notify_reques: Dispatching Notify on [SLPB] (Device) Value 0x80 (Status Change) Node 00000000f0e6819e
>> [6.802873] PM: suspend entry (s2idle)
>> [6.806201] Filesystems sync: 0.002 seconds
>> [6.807580] Freezing user space processes
>> [6.809478] Freezing user space processes completed (elapsed 0.001 seconds)
>> [6.810602] OOM killer disabled.
>> [6.811111] Freezing remaining freezable tasks
>> [6.812953] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
>> [6.814126] printk: Suspending console(s) (use no_console_suspend to debug)
>>
>> But that seems to be all, depicting that sleep/wakeup for ARM is broken
>> and there are still missing some pieces of the puzzle.
>>
>> Nonetheless, we would like to take this RFC as an opportunity for updates
>> on this subject as possible roadmaps.
>>
>> 1) https://urldefense.com/v3/__https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06478.html__;!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN323zzSb8$
>> 2) https://urldefense.com/v3/__https://lore.kernel.org/all/20210920095316.2dd133be@redhat.com/T/*mfe24f89778020deeacfe45083f3eea3cf9f55961__;Iw!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN34RUikoM$
>> 3) https://urldefense.com/v3/__https://lore.kernel.org/all/20231205002143.562-1-annie.li@oracle.com/T/__;!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN3zrJlck4$
>>
>>
>> Annie Li (6):
>>    acpi: hmp/qmp: Add hmp/qmp support for system_sleep
>>    acpi: Implement control method sleep button
>>    test/acpi: allow DSDT table changes
>>    acpi: Support Control Method sleep button for x86
>>    tests/acpi: Update DSDT tables for Control method sleep button
>>    acpi: Send the GPE event of suspend and wakeup for x86
>>
>> Miguel Luis (5):
>>    hw/acpi: Add ACPI GED support for the sleep event
>>    tests/acpi: allow FACP and DSDT table changes for arm/virt
>>    hw/arm: enable sleep support for arm/virt
>>    tests/acpi: Update FACP and DSDT tables for sleep button
>>    arm/virt: enable sleep support
>>
>>   hmp-commands.hx                               |  14 +++++
>>   hw/acpi/control_method_device.c               |  54 ++++++++++++++++++
>>   hw/acpi/core.c                                |  17 ++++--
>>   hw/acpi/generic_event_device.c                |   9 +++
>>   hw/acpi/meson.build                           |   1 +
>>   hw/arm/virt-acpi-build.c                      |  13 +++++
>>   hw/arm/virt.c                                 |  14 ++++-
>>   hw/core/machine-hmp-cmds.c                    |   5 ++
>>   hw/core/machine-qmp-cmds.c                    |  11 ++++
>>   hw/i386/acpi-build.c                          |   9 +++
>>   include/hw/acpi/acpi.h                        |   1 +
>>   include/hw/acpi/acpi_dev_interface.h          |   1 +
>>   include/hw/acpi/control_method_device.h       |  25 ++++++++
>>   include/hw/acpi/generic_event_device.h        |   1 +
>>   include/hw/arm/virt.h                         |   1 +
>>   include/monitor/hmp.h                         |   1 +
>>   qapi/machine.json                             |  18 ++++++
>>   qapi/pragma.json                              |   1 +
>>   tests/data/acpi/aarch64/virt/DSDT             | Bin 5196 -> 5278 bytes
>>   .../data/acpi/aarch64/virt/DSDT.acpihmatvirt  | Bin 5282 -> 5364 bytes
>>   tests/data/acpi/aarch64/virt/DSDT.memhp       | Bin 6557 -> 6639 bytes
>>   tests/data/acpi/aarch64/virt/DSDT.pxb         | Bin 7679 -> 7761 bytes
>>   tests/data/acpi/aarch64/virt/DSDT.topology    | Bin 5398 -> 5480 bytes
>>   tests/data/acpi/aarch64/virt/FACP             | Bin 276 -> 276 bytes
>>   tests/data/acpi/x86/pc/DSDT                   | Bin 6830 -> 7012 bytes
>>   tests/data/acpi/x86/pc/DSDT.acpierst          | Bin 6741 -> 6923 bytes
>>   tests/data/acpi/x86/pc/DSDT.acpihmat          | Bin 8155 -> 8337 bytes
>>   tests/data/acpi/x86/pc/DSDT.bridge            | Bin 13701 -> 13883 bytes
>>   tests/data/acpi/x86/pc/DSDT.cphp              | Bin 7294 -> 7476 bytes
>>   tests/data/acpi/x86/pc/DSDT.dimmpxm           | Bin 8484 -> 8666 bytes
>>   tests/data/acpi/x86/pc/DSDT.hpbridge          | Bin 6781 -> 6963 bytes
>>   tests/data/acpi/x86/pc/DSDT.hpbrroot          | Bin 3337 -> 3519 bytes
>>   tests/data/acpi/x86/pc/DSDT.ipmikcs           | Bin 6902 -> 7084 bytes
>>   tests/data/acpi/x86/pc/DSDT.memhp             | Bin 8189 -> 8371 bytes
>>   tests/data/acpi/x86/pc/DSDT.nohpet            | Bin 6688 -> 6870 bytes
>>   tests/data/acpi/x86/pc/DSDT.numamem           | Bin 6836 -> 7018 bytes
>>   tests/data/acpi/x86/pc/DSDT.roothp            | Bin 10623 -> 10805 bytes
>>   tests/data/acpi/x86/q35/DSDT                  | Bin 8355 -> 8537 bytes
>>   tests/data/acpi/x86/q35/DSDT.acpierst         | Bin 8372 -> 8554 bytes
>>   tests/data/acpi/x86/q35/DSDT.acpihmat         | Bin 9680 -> 9862 bytes
>>   .../acpi/x86/q35/DSDT.acpihmat-noinitiator    | Bin 8634 -> 8816 bytes
>>   tests/data/acpi/x86/q35/DSDT.applesmc         | Bin 8401 -> 8583 bytes
>>   tests/data/acpi/x86/q35/DSDT.bridge           | Bin 11968 -> 12150 bytes
>>   tests/data/acpi/x86/q35/DSDT.core-count       | Bin 12913 -> 13095 bytes
>>   tests/data/acpi/x86/q35/DSDT.core-count2      | Bin 33770 -> 33952 bytes
>>   tests/data/acpi/x86/q35/DSDT.cphp             | Bin 8819 -> 9001 bytes
>>   tests/data/acpi/x86/q35/DSDT.cxl              | Bin 9714 -> 9896 bytes
>>   tests/data/acpi/x86/q35/DSDT.dimmpxm          | Bin 10009 -> 10191 bytes
>>   tests/data/acpi/x86/q35/DSDT.ipmibt           | Bin 8430 -> 8612 bytes
>>   tests/data/acpi/x86/q35/DSDT.ipmismbus        | Bin 8443 -> 8625 bytes
>>   tests/data/acpi/x86/q35/DSDT.ivrs             | Bin 8372 -> 8554 bytes
>>   tests/data/acpi/x86/q35/DSDT.memhp            | Bin 9714 -> 9896 bytes
>>   tests/data/acpi/x86/q35/DSDT.mmio64           | Bin 9485 -> 9667 bytes
>>   tests/data/acpi/x86/q35/DSDT.multi-bridge     | Bin 13208 -> 13390 bytes
>>   tests/data/acpi/x86/q35/DSDT.noacpihp         | Bin 8235 -> 8417 bytes
>>   tests/data/acpi/x86/q35/DSDT.nohpet           | Bin 8213 -> 8395 bytes
>>   tests/data/acpi/x86/q35/DSDT.numamem          | Bin 8361 -> 8543 bytes
>>   tests/data/acpi/x86/q35/DSDT.pvpanic-isa      | Bin 8456 -> 8638 bytes
>>   tests/data/acpi/x86/q35/DSDT.thread-count     | Bin 12913 -> 13095 bytes
>>   tests/data/acpi/x86/q35/DSDT.thread-count2    | Bin 33770 -> 33952 bytes
>>   tests/data/acpi/x86/q35/DSDT.tis.tpm12        | Bin 8961 -> 9143 bytes
>>   tests/data/acpi/x86/q35/DSDT.tis.tpm2         | Bin 8987 -> 9169 bytes
>>   tests/data/acpi/x86/q35/DSDT.type4-count      | Bin 18589 -> 18771 bytes
>>   tests/data/acpi/x86/q35/DSDT.viot             | Bin 9464 -> 9646 bytes
>>   tests/data/acpi/x86/q35/DSDT.xapic            | Bin 35718 -> 35900 bytes
>>   65 files changed, 191 insertions(+), 5 deletions(-)
>>   create mode 100644 hw/acpi/control_method_device.c
>>   create mode 100644 include/hw/acpi/control_method_device.h
>>


      reply	other threads:[~2024-10-08 15:22 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
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 [this message]

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=80483b29-2334-46a2-a95c-649d898a1fd6@oracle.com \
    --to=annie.li@oracle.com \
    --cc=anisinha@redhat.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=miguel.luis@oracle.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).