Skip to content

RFC Support ACPI Control Method Sleep button

Annie Li qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest13 patches 32 repliesIn review
  2. v2 RFC11 patches 11 repliesSuperseded
  3. v1 RFC11 patches 6 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13acpi: Implement control method sleep buttonhw/acpi/control_method_device.c hw/acpi/meson.build include/hw/acpi/control_method_device.h+55 -02 replies
2/13test/acpi: allow DSDT table changes for x86 platformtests/qtest/bios-tables-test-allowed-diff.h+42 -02 replies
3/13acpi: Support Control Method sleep button for x86hw/i386/acpi-build.c+21 -12 replies
4/13tests/qtest/bios-table-tests: Update ACPI table binaries for x86tests/data/acpi/x86/pc/DSDT tests/data/acpi/x86/pc/DSDT.acpierst tests/data/acpi/x86/pc/DSDT.acpihmat +41 more+28 -452 replies
5/13acpi: Send the GPE event of suspend and wakeup for x86hw/acpi/core.c include/hw/acpi/acpi.h include/hw/acpi/acpi_dev_interface.h+12 -09 replies
6/13test/acpi: allow DSDT table changes for microvmtests/qtest/bios-tables-test-allowed-diff.h+5 -02 replies
7/13microvm: support control method sleep buttonhw/i386/acpi-microvm.c include/hw/acpi/generic_event_device.h+12 -02 replies
8/13hw/acpi: Add ACPI GED support for the sleep eventhw/acpi/generic_event_device.c include/hw/acpi/generic_event_device.h+10 -01 reply
9/13microvm: enable sleep GED eventhw/i386/microvm.c+2 -12 replies
10/13tests/qtest/bios-table-tests: Update ACPI table binaries for microvmtests/data/acpi/x86/microvm/DSDT tests/data/acpi/x86/microvm/DSDT.ioapic2 tests/data/acpi/x86/microvm/DSDT.pcie +4 more+29 -82 replies
11/13microvm: suspend the system as requestedhw/acpi/generic_event_device.c+3 -01 reply
12/13microvm: enable suspendhw/i386/microvm.c+1 -01 reply
13/13acpi: hmp/qmp: Add hmp/qmp support for system_sleephmp-commands.hx hw/core/machine-hmp-cmds.c hw/core/machine-qmp-cmds.c +3 more+52 -04 replies

Reviews trailers per patch

9 of 13 patches have a Reviewed-by or Acked-by.

PatchMarkus ArmbrusterGustavo Romero
1/13
2/13R-b
3/13
4/13R-b
5/13
6/13R-b
7/13
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13R-b
13/13A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [RFC V3 PATCH 00/13] Support ACPI Control Method Sleep button

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 Microvm.(The V1 patch set was posted previously here 3). We rebase all the patches on QEMU9.1.0 and re-post V2 here 4). This V3 patch set here is rebased on QEMU 10.0.0-rc3. The sleep button support for MicroVM is added, however, its support for ARM platform in V2 is removed due to lower interests of it and more efforts in the firmware.

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, this sleep button works as expected.

For MicroVM, a GED event is triggered to notify the OSPM. This GED event is also applicable for ARM platform, but this V3 patch set doesn't cover ARM platform as what V2 did 4). Tests have been done for Linux MicroVM guests.

System_wakeup doesn't work for MicroVM for now due to the missing support of it. This patch set only covers system_sleep, not the wakeup part.

1) https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06478.html
2) https://lore.kernel.org/all/[email protected]/T/#mfe24f89778020deeacfe45083f3eea3cf9f55961
3) https://lore.kernel.org/all/[email protected]/T/
4) https://patchwork.kernel.org/project/qemu-devel/cover/[email protected]/

----Changes from V2----
Replace license with SPDX-License-Identifier
Rebase the patch set on qemu 10.0.0-rc3
Reorder the patch
Improve descriptions for system_sleep
Improve comments and format
Support system_sleep for microvm
Remove patches for ARM
----------------------

----Changes from V1----
Rebase the patch set on qemu 9.1.0-rc4
-----------------------

Annie Li (12):
acpi: Implement control method sleep button
test/acpi: allow DSDT table changes for x86 platform
acpi: Support Control Method sleep button for x86 tests/qtest/bios-table-tests: Update ACPI table binaries for x86
acpi: Send the GPE event of suspend and wakeup for x86 test/acpi: allow DSDT table changes for microvm
microvm: support control method sleep button
microvm: enable sleep GED event tests/qtest/bios-table-tests: Update ACPI table binaries for microvm
microvm: suspend the system as requested
microvm: enable suspend
acpi: hmp/qmp: Add hmp/qmp support for system_sleep

Miguel Luis (1):
hw/acpi: Add ACPI GED support for the sleep event

 hmp-commands.hx                               |  14 ++++++++
 hw/acpi/control_method_device.c               |  33 ++++++++++++++++++
 hw/acpi/core.c                                |  10 ++++++
 hw/acpi/generic_event_device.c                |  12 +++++++
 hw/acpi/meson.build                           |   1 +
 hw/core/machine-hmp-cmds.c                    |   5 +++
 hw/core/machine-qmp-cmds.c                    |  11 ++++++
 hw/i386/acpi-build.c                          |  22 +++++++++++-
 hw/i386/acpi-microvm.c                        |  11 ++++++
 hw/i386/microvm.c                             |   4 ++-
 include/hw/acpi/acpi.h                        |   1 +
 include/hw/acpi/acpi_dev_interface.h          |   1 +
 include/hw/acpi/control_method_device.h       |  21 +++++++++++
 include/hw/acpi/generic_event_device.h        |   2 ++
 include/monitor/hmp.h                         |   1 +
 qapi/machine.json                             |  20 +++++++++++
 qapi/pragma.json                              |   1 +
 tests/data/acpi/x86/microvm/DSDT              | Bin 365 -> 442 bytes
 tests/data/acpi/x86/microvm/DSDT.ioapic2      | Bin 365 -> 442 bytes
 tests/data/acpi/x86/microvm/DSDT.pcie         | Bin 3023 -> 3100 bytes
 tests/data/acpi/x86/microvm/DSDT.rtc          | Bin 404 -> 481 bytes
 tests/data/acpi/x86/microvm/DSDT.usb          | Bin 414 -> 491 bytes
 tests/data/acpi/x86/pc/DSDT                   | Bin 8611 -> 8721 bytes
 tests/data/acpi/x86/pc/DSDT.acpierst          | Bin 8522 -> 8632 bytes
 tests/data/acpi/x86/pc/DSDT.acpihmat          | Bin 9936 -> 10046 bytes
 tests/data/acpi/x86/pc/DSDT.bridge            | Bin 15482 -> 15592 bytes
 tests/data/acpi/x86/pc/DSDT.cphp              | Bin 9075 -> 9185 bytes
 tests/data/acpi/x86/pc/DSDT.dimmpxm           | Bin 10265 -> 10375 bytes
 tests/data/acpi/x86/pc/DSDT.hpbridge          | Bin 8562 -> 8672 bytes
 tests/data/acpi/x86/pc/DSDT.hpbrroot          | Bin 5100 -> 5210 bytes
 tests/data/acpi/x86/pc/DSDT.ipmikcs           | Bin 8683 -> 8793 bytes
 tests/data/acpi/x86/pc/DSDT.memhp             | Bin 9970 -> 10080 bytes
 tests/data/acpi/x86/pc/DSDT.nohpet            | Bin 8469 -> 8579 bytes
 tests/data/acpi/x86/pc/DSDT.numamem           | Bin 8617 -> 8727 bytes
 tests/data/acpi/x86/pc/DSDT.roothp            | Bin 12404 -> 12514 bytes
 tests/data/acpi/x86/q35/DSDT                  | Bin 8440 -> 8550 bytes
 tests/data/acpi/x86/q35/DSDT.acpierst         | Bin 8457 -> 8567 bytes
 tests/data/acpi/x86/q35/DSDT.acpihmat         | Bin 9765 -> 9875 bytes
 .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12650 -> 12760 bytes
 .../acpi/x86/q35/DSDT.acpihmat-noinitiator    | Bin 8719 -> 8829 bytes
 tests/data/acpi/x86/q35/DSDT.applesmc         | Bin 8486 -> 8596 bytes
 tests/data/acpi/x86/q35/DSDT.bridge           | Bin 12053 -> 12163 bytes
 tests/data/acpi/x86/q35/DSDT.core-count       | Bin 12998 -> 13108 bytes
 tests/data/acpi/x86/q35/DSDT.core-count2      | Bin 33855 -> 33965 bytes
 tests/data/acpi/x86/q35/DSDT.cphp             | Bin 8904 -> 9014 bytes
 tests/data/acpi/x86/q35/DSDT.cxl              | Bin 13231 -> 13341 bytes
 tests/data/acpi/x86/q35/DSDT.dimmpxm          | Bin 10094 -> 10204 bytes
 tests/data/acpi/x86/q35/DSDT.ipmibt           | Bin 8515 -> 8625 bytes
 tests/data/acpi/x86/q35/DSDT.ipmismbus        | Bin 8528 -> 8638 bytes
 tests/data/acpi/x86/q35/DSDT.ivrs             | Bin 8457 -> 8567 bytes
 tests/data/acpi/x86/q35/DSDT.memhp            | Bin 9799 -> 9909 bytes
 tests/data/acpi/x86/q35/DSDT.mmio64           | Bin 9570 -> 9680 bytes
 tests/data/acpi/x86/q35/DSDT.multi-bridge     | Bin 13293 -> 13403 bytes
 tests/data/acpi/x86/q35/DSDT.noacpihp         | Bin 8302 -> 8412 bytes
 tests/data/acpi/x86/q35/DSDT.nohpet           | Bin 8298 -> 8408 bytes
 tests/data/acpi/x86/q35/DSDT.numamem          | Bin 8446 -> 8556 bytes
 tests/data/acpi/x86/q35/DSDT.pvpanic-isa      | Bin 8541 -> 8651 bytes
 tests/data/acpi/x86/q35/DSDT.thread-count     | Bin 12998 -> 13108 bytes
 tests/data/acpi/x86/q35/DSDT.thread-count2    | Bin 33855 -> 33965 bytes
 tests/data/acpi/x86/q35/DSDT.tis.tpm12        | Bin 9046 -> 9156 bytes
 tests/data/acpi/x86/q35/DSDT.tis.tpm2         | Bin 9072 -> 9182 bytes
 tests/data/acpi/x86/q35/DSDT.type4-count      | Bin 18674 -> 18784 bytes
 tests/data/acpi/x86/q35/DSDT.viot             | Bin 14697 -> 14807 bytes
 tests/data/acpi/x86/q35/DSDT.xapic            | Bin 35803 -> 35913 bytes
 64 files changed, 168 insertions(+), 2 deletions(-)
 create mode 100644 hw/acpi/control_method_device.c
 create mode 100644 include/hw/acpi/control_method_device.h
Signature · 1 line
2.43.5