Support ACPI Control Method Sleep button
v3 cover 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
RFC PATCH v3 1/13 acpi: Implement control method sleep button
The fixed hardware sleep button isn't appropriate for hardware reduced platform. This patch implements the control method sleep button in a separate source file so that the button can be added for various platforms.
--- hw/acpi/control_method_device.c | 33 +++++++++++++++++++++++++ hw/acpi/meson.build | 1 + include/hw/acpi/control_method_device.h | 21 ++++++++++++++++ 3 files changed, 55 insertions(+)
hw/acpi/control_method_device.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +* +* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hw/acpi/control_method_device.h" +#include "hw/mem/nvdimm.h" + +/* +* The control method sleep button[ACPI v6.5 Section 4.8.2.2.2.2] +* resides in generic hardware address spaces. The sleep button +* is defined as _HID("PNP0C0E") that associates with device "SLPB". +*/ +void acpi_dsdt_add_sleep_button (Aml *scope) +{ +Aml *dev =aml_device (ACPI_SLEEP_BUTTON_DEVICE ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C0E" ))); +aml_append (dev,aml_operation_region ("\\SLP" ,AML_SYSTEM_IO , +aml_int (0x201 ),0x1 )); +Aml *field =aml_field ("\\SLP" ,AML_BYTE_ACC ,AML_NOLOCK , +AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("SBP" ,1 )); +aml_append (dev, field); +aml_append (scope, dev); +}
hw/acpi/meson.build +1 -0
@@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('c acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) +acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('control_method_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c'))
include/hw/acpi/control_method_device.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +* +* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + + +#ifndef HW_ACPI_CONTROL_METHOD_DEVICE_H +#define HW_ACPI_CONTROL_NETHOD_DEVICE_H + +#define ACPI_SLEEP_BUTTON_DEVICE "SLPB" + +void acpi_dsdt_add_sleep_button (Aml *scope); + +#endif
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 01/13] acpi: Implement control method sleep button
Hi Annie,
Quoted 24 lines · Annie Li
The fixed hardware sleep button isn't appropriate for hardware reduced platform. This patch implements the control method sleep button in a separate source file so that the button can be added for various platforms.
Co-developed-by Miguel Luis <[email protected]>Signed-off-by Annie Li <[email protected]>--- hw/acpi/control_method_device.c | 33 +++++++++++++++++++++++++ hw/acpi/meson.build | 1 + include/hw/acpi/control_method_device.h | 21 ++++++++++++++++ 3 files changed, 55 insertions(+)hw/acpi/control_method_device.c new file +5
-0@@ -0,0 +1,33 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +*
hw/acpi/control_method_device.c line 15
Quoted 10 lines
hw/acpi/control_method_device.c new file +10
-0+* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hw/acpi/control_method_device.h" +#include "hw/mem/nvdimm.h"
NVDIMM is out of context here, please use:
#include "hw/acpi/aml-build.h"
instead for the aml_* symbols.
hw/acpi/control_method_device.c line 25
Quoted 9 lines
hw/acpi/control_method_device.c new file +9
-0+/* +* The control method sleep button[ACPI v6.5 Section 4.8.2.2.2.2] +* resides in generic hardware address spaces. The sleep button +* is defined as _HID("PNP0C0E") that associates with device "SLPB". +*/ +void acpi_dsdt_add_sleep_button (Aml *scope) +{ +Aml *dev =aml_device (ACPI_SLEEP_BUTTON_DEVICE ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0C0E" )));
I see that since GPE event handler L07 will be tied to the sleep button device there is no _PRW variable defined here. Do you mind adding a comment here about it? Something like:
/* No _PRW, the sleeping button device is always tied to GPE L07 event handler. */
Cheers,
Gustavo
Quoted 47 lines
hw/acpi/control_method_device.c new file +8
-0+aml_append (dev,aml_operation_region ("\\SLP" ,AML_SYSTEM_IO , +aml_int (0x201 ),0x1 )); +Aml *field =aml_field ("\\SLP" ,AML_BYTE_ACC ,AML_NOLOCK , +AML_WRITE_AS_ZEROS ); +aml_append (field,aml_named_field ("SBP" ,1 )); +aml_append (dev, field); +aml_append (scope, dev); +}hw/acpi/meson.build +1
-0@@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('c acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) +acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('control_method_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c'))include/hw/acpi/control_method_device.h new file +21
-0@@ -0,0 +1,21 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +* +* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + + +#ifndef HW_ACPI_CONTROL_METHOD_DEVICE_H +#define HW_ACPI_CONTROL_NETHOD_DEVICE_H + +#define ACPI_SLEEP_BUTTON_DEVICE "SLPB" + +void acpi_dsdt_add_sleep_button (Aml *scope); + +#endif
Re: [RFC V3 PATCH 01/13] acpi: Implement control method sleep button
Hi Gustavo,
Quoted 40 lines · Gustavo Romero
Hi Annie,
Quoted 24 lines · Annie Li
The fixed hardware sleep button isn't appropriate for hardware reduced platform. This patch implements the control method sleep button in a separate source file so that the button can be added for various platforms.
Co-developed-by Miguel Luis <[email protected]>Signed-off-by Annie Li <[email protected]>---
hw/acpi/control_method_device.c | 33 +++++++++++++++++++++++++ hw/acpi/meson.build | 1 +include/hw/acpi/control_method_device.h| 21 ++++++++++++++++3 files changed, 55 insertions(+)hw/acpi/control_method_device.c new file +5
-0@@ -0,0 +1,33 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +* hw/acpi/control_method_device.c line 15
Quoted 10 lines
hw/acpi/control_method_device.c new file +10
-0+* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hw/acpi/control_method_device.h" +#include "hw/mem/nvdimm.h" NVDIMM is out of context here, please use:
Quoted 3 lines
#include "
hw/acpi/aml-build.h"instead for the aml_* symbols.
Nod
Quoted 16 lines
hw/acpi/control_method_device.c line 25
Quoted 11 lines
hw/acpi/control_method_device.c new file +9
-0+/* +* The control method sleep button[ACPI v6.5 Section 4.8.2.2.2.2] +* resides in generic hardware address spaces. The sleep button +* is defined as _HID("PNP0C0E") that associates with device "SLPB". +*/ +void acpi_dsdt_add_sleep_button (Aml *scope) +{ + Aml *dev = aml_device(ACPI_SLEEP_BUTTON_DEVICE); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0E")));I see that since GPE event handler L07 will be tied to the sleep button device there is no
_PRWvariable defined here. Do you mind adding a comment here about it? Something like:
Quoted 1 line
/* No
_PRW, the sleeping button device is always tied to GPE L07 event handler. */
Will add comments about it.
Thanks
Annie
Quoted 55 lines
Cheers,
GustavoQuoted 49 lines
hw/acpi/control_method_device.c new file +8
-0+ aml_append(dev, aml_operation_region("\\SLP", AML_SYSTEM_IO, + aml_int(0x201), 0x1)); + Aml *field = aml_field("\\SLP", AML_BYTE_ACC, AML_NOLOCK, + AML_WRITE_AS_ZEROS); + aml_append(field, aml_named_field("SBP", 1)); + aml_append(dev, field); + aml_append(scope, dev); +}hw/acpi/meson.build +0
-0@@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true:files('cxl.c'),
if_false: files('c
acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c'))acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c'))acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c'))+acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED',if_true:files('control_method_device.c'))
acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c'))acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c'))acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c'))include/hw/acpi/control_method_device.h new file +21
-0@@ -0,0 +1,21 @@ +/* +* Control Method Device +* +* Copyright (c) 2023 Oracle and/or its affiliates. +* +* +* Authors: +* Annie Li <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + + +#ifndef HW_ACPI_CONTROL_METHOD_DEVICE_H +#define HW_ACPI_CONTROL_NETHOD_DEVICE_H + +#define ACPI_SLEEP_BUTTON_DEVICE "SLPB" + +void acpi_dsdt_add_sleep_button (Aml *scope); + +#endif
RFC PATCH v3 2/13 test/acpi: allow DSDT table changes for x86 platform
In reply to Annie Lilist changed files in tests/qtest/bios-tables-test-allowed-diff.h
--- tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +42 -0
@@ -1 +1,43 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.hpbrroot" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.noacpihp" , +"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.xapic",
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 02/13] test/acpi: allow DSDT table changes for x86 platform
Hi Annie,
Quoted 1 line · Annie Li
list changed files in
tests/qtest/bios-tables-test-allowed-diff.h
nit: List
Quoted 43 lines
Signed-off-by Annie Li <[email protected]>--- tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+)tests/qtest/bios-tables-test-allowed-diff.h +32
-0@@ -1 +1,43 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.hpbrroot" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.noacpihp",
tests/qtest/bios-tables-test-allowed-diff.h line 43
Quoted 10 lines
tests/qtest/bios-tables-test-allowed-diff.h +10
-0+"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.xapic",
Cheers,
Gustavo
Re: [RFC V3 PATCH 02/13] test/acpi: allow DSDT table changes for x86 platform
Hi Gustavo,
Quoted 6 lines · Gustavo Romero
Hi Annie,
Quoted 1 line · Annie Li
list changed files in
tests/qtest/bios-tables-test-allowed-diff.hnit: List
Will fix it.
Thanks
Annie
Quoted 61 lines
Quoted 45 lines
Signed-off-by Annie Li <[email protected]>---
tests/qtest/bios-tables-test-allowed-diff.h| 42 +++++++++++++++++++++1 file changed, 42 insertions(+)tests/qtest/bios-tables-test-allowed-diff.h +32
-0@@ -1 +1,43 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.hpbrroot" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.noacpihp",tests/qtest/bios-tables-test-allowed-diff.h line 43
Quoted 10 lines
tests/qtest/bios-tables-test-allowed-diff.h +10
-0+"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.xapic",Reviewed-by Gustavo Romero <[email protected]>Cheers,
Gustavo
RFC PATCH v3 3/13 acpi: Support Control Method sleep button for x86
In reply to Annie LiAdd Control Method Sleep button and its GPE event handler for x86 platform. The GPE event handler notifies OSPM when the Sleep button event is triggered.
--- hw/i386/acpi-build.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +21 -1
@@ -40,6 +40,7 @@#include "hw/acpi/acpi_aml_interface.h" #include "hw/input/i8042.h" #include "hw/acpi/memory_hotplug.h" +#include "hw/acpi/control_method_device.h" #include "system/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h"
@@ -1359,7 +1360,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, NULL);Object *q35 =object_resolve_type_unambiguous (TYPE_Q35_HOST_DEVICE ,NULL );CrsRangeEntry *entry; -Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; +Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *condition;CrsRangeSet crs_range_set;PCMachineState *pcms =PC_MACHINE (machine);PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine);
@@ -1465,6 +1466,25 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, }aml_append (dsdt, scope); + sb_scope =aml_scope ("_SB" ); +acpi_dsdt_add_sleep_button (sb_scope); +aml_append (dsdt, sb_scope); + +/* +* The event handler for the control method sleep button is generated +* for notifying OSPM[ACPI v6.5 Section 4.8.2.2.2.]. +*/ + scope =aml_scope ("\\_GPE" ); + method =aml_method ("_L07" ,0 ,AML_NOTSERIALIZED ); + condition =aml_if (aml_name ("\\_SB.SLPB.SBP" )); +aml_append (condition,aml_store (aml_int (1 ),aml_name ("\\_SB.SLPB.SBP" ))); +aml_append (condition, +aml_notify (aml_name ("\\_SB." ACPI_SLEEP_BUTTON_DEVICE ), +aml_int (0x80 ))); +aml_append (method, condition); +aml_append (scope, method); +aml_append (dsdt, scope); +if (pcmc->legacy_cpu_hotplug) {build_legacy_cpu_hotplug_aml (dsdt, machine, pm->cpu_hp_io_base); }else {
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 03/13] acpi: Support Control Method sleep button for x86
Hi Annie,
Quoted 31 lines · Annie Li
Add Control Method Sleep button and its GPE event handler for x86 platform. The GPE event handler notifies OSPM when the Sleep button event is triggered.
Signed-off-by Annie Li <[email protected]>--- hw/i386/acpi-build.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)hw/i386/acpi-build.c +2
-1@@ -40,6 +40,7 @@#include "hw/acpi/acpi_aml_interface.h" #include "hw/input/i8042.h" #include "hw/acpi/memory_hotplug.h" +#include "hw/acpi/control_method_device.h" #include "system/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h" @@ -1359,7 +1360,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, NULL);Object *q35 =object_resolve_type_unambiguous (TYPE_Q35_HOST_DEVICE ,NULL );CrsRangeEntry *entry; -Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; +Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *condition;CrsRangeSet crs_range_set;PCMachineState *pcms =PC_MACHINE (machine);PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine);
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1475
Quoted 10 lines
hw/i386/acpi-build.c +7
-0@@ -1465,6 +1466,25 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, }aml_append (dsdt, scope); + sb_scope =aml_scope ("_SB" ); +acpi_dsdt_add_sleep_button (sb_scope); +aml_append (dsdt, sb_scope); + +/* +* The event handler for the control method sleep button is generated +* for notifying OSPM[ACPI v6.5 Section 4.8.2.2.2.].
Typo: Section 4.8.2.2.2.2
Please use the form "... OSPM (ACPI v6.5, Section 4.8.2.2.2.2)" for citations.
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1480
Quoted 5 lines
hw/i386/acpi-build.c +5
-0+*/ + scope =aml_scope ("\\_GPE" ); + method =aml_method ("_L07" ,0 ,AML_NOTSERIALIZED ); + condition =aml_if (aml_name ("\\_SB.SLPB.SBP" )); +aml_append (condition,aml_store (aml_int (1 ),aml_name ("\\_SB.SLPB.SBP" )));
Why not concatenate with ACPI_SLEEP_BUTTON_DEVICE here and in the conditional above it as it's done below for the Notify()?
Cheers,
Gustavo
Quoted 10 lines
hw/i386/acpi-build.c +7
-0+aml_append (condition, +aml_notify (aml_name ("\\_SB." ACPI_SLEEP_BUTTON_DEVICE ), +aml_int (0x80 ))); +aml_append (method, condition); +aml_append (scope, method); +aml_append (dsdt, scope); +if (pcmc->legacy_cpu_hotplug) {build_legacy_cpu_hotplug_aml (dsdt, machine, pm->cpu_hp_io_base); }else {
Re: [RFC V3 PATCH 03/13] acpi: Support Control Method sleep button for x86
Hi Gustavo,
Quoted 49 lines · Gustavo Romero
Hi Annie,
Quoted 41 lines · Annie Li
Add Control Method Sleep button and its GPE event handler for x86 platform. The GPE event handler notifies OSPM when the Sleep button event is triggered.
Signed-off-by Annie Li <[email protected]>---
hw/i386/acpi-build.c| 22 +++++++++++++++++++++-1 file changed, 21 insertions(+), 1 deletion(-)hw/i386/acpi-build.c +2
-1@@ -40,6 +40,7 @@ #include "hw/acpi/acpi_aml_interface.h" #include "hw/input/i8042.h" #include "hw/acpi/memory_hotplug.h" +#include "hw/acpi/control_method_device.h" #include "system/tpm.h" #include "hw/acpi/tpm.h" #include "hw/acpi/vmgenid.h"@@ -1359,7 +1360,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, NULL); Object *q35 = object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE, NULL); CrsRangeEntry *entry; - Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; + Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs, *condition; CrsRangeSet crs_range_set; PCMachineState *pcms = PC_MACHINE(machine);PCMachineClass *pcmc =
PC_MACHINE_GET_CLASS(machine);hw/i386/acpi-build.c +5
-0@@ -1465,6 +1466,25 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } aml_append(dsdt, scope); + sb_scope = aml_scope("_SB"); + acpi_dsdt_add_sleep_button(sb_scope); + aml_append(dsdt, sb_scope); + + /* +* The event handler for the control method sleep button is Quoted 2 lines
generated
+ * for notifying OSPM[ACPI v6.5 Section 4.8.2.2.2.].Typo: Section 4.8.2.2.2.2
Quoted 2 lines
Please use the form "... OSPM (ACPI v6.5, Section 4.8.2.2.2.2)" for citations.
Ack
Quoted 10 lines
Quoted 7 lines
+ */
+ scope =aml_scope("\\_GPE");
+ method =aml_method("_L07", 0, AML_NOTSERIALIZED); + condition = aml_if(aml_name("\\_SB.SLPB.SBP")); +aml_append(condition, aml_store(aml_int(1), aml_name("\\_SB.SLPB.SBP")));Why not concatenate with
ACPI_SLEEP_BUTTON_DEVICEhere and in the conditional above it as it's done below for theNotify()?
Make sense.
Thanks
Annie
Quoted 16 lines
Cheers,
GustavoQuoted 10 lines
+ aml_append(condition,
+ aml_notify(aml_name("\\_SB."ACPI_SLEEP_BUTTON_DEVICE),
+aml_int(0x80)));
+aml_append(method, condition);
+aml_append(scope, method);
+aml_append(dsdt, scope);
+
if (pcmc->legacy_cpu_hotplug) {build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); } else {
RFC PATCH v3 4/13 tests/qtest/bios-table-tests: Update ACPI table binaries for x86
In reply to Annie LiFollowing is the diff generated by the step 5 and 6 in tests/qtest/bios-tables-test.c
Diff from iasl to show changes in DSDT table:
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +28 -3
@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025 + * Disassembly of /tmp/aml-EMBW42, Wed Apr 9 19:04:34 2025 * * Original Table Header: * Signature "DSDT" - * Length 0x000020F8 (8440) + * Length 0x00002166 (8550) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0xBE + * Checksum 0x1E * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Scope (\) { OperationRegion (DBG, SystemIO, 0x0402, One) Field (DBG, ByteAcc, NoLock, Preserve) { DBGB, 8 }
@@ -2852,32 +2852,57 @@ { Memory32Fixed (ReadOnly, 0xFED00000, // Address Base 0x00000400, // Address Length ) }) } } Scope (_GPE) { Name (_HID, "ACPI0006" /* GPE Block Device */) // _HID: Hardware ID } Scope (_SB) { + Device (SLPB) + { + Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID + OperationRegion (\SLP, SystemIO, 0x0201, One) + Field (\SLP, ByteAcc, NoLock, WriteAsZeros) + { + SBP, 1 + } + } + } + + Scope (\_GPE) + { + Method (_L07, 0, NotSerialized) // _Lxx: Level-Triggered GPE, xx=0x00-0xFF + { + If (\_SB.SLPB.SBP) + { + \_SB.SLPB.SBP = One + Notify (\_SB.SLPB, 0x80) // Status Change + } + } + } + + Scope (_SB) + { Device (\_SB.PCI0.PRES) { Name (_HID, EisaId ("PNP0A06") /* Generic Container Device */) // _HID: Hardware ID Name (_UID, "CPU Hotplug resources") // _UID: Unique ID Mutex (CPLK, 0x00) Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0CD8, // Range Minimum 0x0CD8, // Range Maximum 0x01, // Alignment 0x0C, // Length ) }) OperationRegion (PRST, SystemIO, 0x0CD8, 0x0C) Field (PRST, ByteAcc, NoLock, WriteAsZeros)
--- 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 tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------ 43 files changed, 42 deletions(-)
tests/data/acpi/x86/pc/DSDT binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
tests/data/acpi/x86/q35/DSDT binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -42
43 lines not on this page · raw message
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 04/13] tests/qtest/bios-table-tests: Update ACPI table binaries for x86
Hi Annie,
Quoted 8 lines · Annie Li
Following is the diff generated by the step 5 and 6 in
tests/qtest/bios-tables-test.cDiff from iasl to show changes in DSDT table:
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 line 8
Quoted 9 lines
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +1
-1@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025 + * Disassembly of /tmp/aml-EMBW42, Wed Apr 9 19:04:34 2025
This complete valid diff in the commit message seems to confuse git am and b4. Please remove the initial 2 lines to make it invalid, i.e. remove:
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000
Quoted 2 lines
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +0
-0
Also, to me, it's simple to concat:
Quoted 2 lines
- * Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025
+ * Disassembly of/tmp/aml-EMBW42, Wed Apr 9 19:04:34 2025
into:
Quoted 1 line
* Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025
since /tmp/aml-EMBW42 brings no information to the commit message.
Otherwise:
Cheers,
Gustavo
Quoted 640 lines
*
* Original Table Header:
* Signature "DSDT"- * Length 0x000020F8 (8440) + * Length 0x00002166 (8550) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0xBE + * Checksum 0x1E * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Scope (\) { OperationRegion (DBG, SystemIO, 0x0402, One) Field (DBG, ByteAcc, NoLock, Preserve) { DBGB, 8 }tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +25
-0@@ -2852,32 +2852,57 @@ { Memory32Fixed (ReadOnly, 0xFED00000, // Address Base 0x00000400, // Address Length ) }) } } Scope (_GPE) { Name (_HID, "ACPI0006" /* GPE Block Device */) // _HID: Hardware ID } Scope (_SB) { + Device (SLPB) + { + Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID + OperationRegion (\SLP, SystemIO, 0x0201, One) + Field (\SLP, ByteAcc, NoLock, WriteAsZeros) + { + SBP, 1 + } + } + } + + Scope (\_GPE) + { + Method (_L07, 0, NotSerialized) // _Lxx: Level-Triggered GPE, xx=0x00-0xFF + { + If (\_SB.SLPB.SBP) + { + \_SB.SLPB.SBP = One + Notify (\_SB.SLPB, 0x80) // Status Change + } + } + } + + Scope (_SB) + { Device (\_SB.PCI0.PRES) { Name (_HID, EisaId ("PNP0A06") /* Generic Container Device */) // _HID: Hardware ID Name (_UID, "CPU Hotplug resources") // _UID: Unique ID Mutex (CPLK, 0x00) Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { IO (Decode16, 0x0CD8, // Range Minimum 0x0CD8, // Range Maximum 0x01, // Alignment 0x0C, // Length ) }) OperationRegion (PRST, SystemIO, 0x0CD8, 0x0C) Field (PRST, ByteAcc, NoLock, WriteAsZeros)Signed-off-by Annie Li <[email protected]>--- 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 tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------ 43 files changed, 42 deletions(-)tests/data/acpi/x86/pc/DSDT binary +0
-0tests/data/acpi/x86/pc/DSDT.acpierst binary +0
-0tests/data/acpi/x86/pc/DSDT.acpihmat binary +0
-0tests/data/acpi/x86/pc/DSDT.bridge binary +0
-0tests/data/acpi/x86/pc/DSDT.cphp binary +0
-0tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0
-0tests/data/acpi/x86/pc/DSDT.hpbridge binary +0
-0tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0
-0tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0
-0tests/data/acpi/x86/pc/DSDT.memhp binary +0
-0tests/data/acpi/x86/pc/DSDT.nohpet binary +0
-0tests/data/acpi/x86/pc/DSDT.numamem binary +0
-0tests/data/acpi/x86/pc/DSDT.roothp binary +0
-0tests/data/acpi/x86/q35/DSDT binary +0
-0tests/data/acpi/x86/q35/DSDT.acpierst binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0
-0tests/data/acpi/x86/q35/DSDT.applesmc binary +0
-0tests/data/acpi/x86/q35/DSDT.bridge binary +0
-0tests/data/acpi/x86/q35/DSDT.core-count binary +0
-0tests/data/acpi/x86/q35/DSDT.core-count2 binary +0
-0tests/data/acpi/x86/q35/DSDT.cphp binary +0
-0tests/data/acpi/x86/q35/DSDT.cxl binary +0
-0tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0
-0tests/data/acpi/x86/q35/DSDT.ipmibt binary +0
-0tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0
-0tests/data/acpi/x86/q35/DSDT.ivrs binary +0
-0tests/data/acpi/x86/q35/DSDT.memhp binary +0
-0tests/data/acpi/x86/q35/DSDT.mmio64 binary +0
-0tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0
-0tests/data/acpi/x86/q35/DSDT.noacpihp binary +0
-0tests/data/acpi/x86/q35/DSDT.nohpet binary +0
-0tests/data/acpi/x86/q35/DSDT.numamem binary +0
-0tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0
-0tests/data/acpi/x86/q35/DSDT.thread-count binary +0
-0tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0
-0tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0
-0tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0
-0tests/data/acpi/x86/q35/DSDT.type4-count binary +0
-0tests/data/acpi/x86/q35/DSDT.viot binary +0
-0tests/data/acpi/x86/q35/DSDT.xapic binary +0
-0tests/qtest/bios-tables-test-allowed-diff.h +0
-42@@ -1,43 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT" , -"tests/data/acpi/x86/pc/DSDT.acpierst" , -"tests/data/acpi/x86/pc/DSDT.acpihmat" , -"tests/data/acpi/x86/pc/DSDT.bridge" , -"tests/data/acpi/x86/pc/DSDT.cphp" , -"tests/data/acpi/x86/pc/DSDT.dimmpxm" , -"tests/data/acpi/x86/pc/DSDT.hpbridge" , -"tests/data/acpi/x86/pc/DSDT.hpbrroot" , -"tests/data/acpi/x86/pc/DSDT.ipmikcs" , -"tests/data/acpi/x86/pc/DSDT.memhp" , -"tests/data/acpi/x86/pc/DSDT.nohpet" , -"tests/data/acpi/x86/pc/DSDT.numamem" , -"tests/data/acpi/x86/pc/DSDT.roothp" , -"tests/data/acpi/x86/q35/DSDT" , -"tests/data/acpi/x86/q35/DSDT.acpierst" , -"tests/data/acpi/x86/q35/DSDT.acpihmat" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/x86/q35/DSDT.applesmc" , -"tests/data/acpi/x86/q35/DSDT.bridge" , -"tests/data/acpi/x86/q35/DSDT.core-count" , -"tests/data/acpi/x86/q35/DSDT.core-count2" , -"tests/data/acpi/x86/q35/DSDT.cphp" , -"tests/data/acpi/x86/q35/DSDT.cxl" , -"tests/data/acpi/x86/q35/DSDT.dimmpxm" , -"tests/data/acpi/x86/q35/DSDT.ipmibt" , -"tests/data/acpi/x86/q35/DSDT.ipmismbus" , -"tests/data/acpi/x86/q35/DSDT.ivrs" , -"tests/data/acpi/x86/q35/DSDT.memhp" , -"tests/data/acpi/x86/q35/DSDT.mmio64" , -"tests/data/acpi/x86/q35/DSDT.multi-bridge" , -"tests/data/acpi/x86/q35/DSDT.noacpihp" , -"tests/data/acpi/x86/q35/DSDT.nohpet" , -"tests/data/acpi/x86/q35/DSDT.numamem" , -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/x86/q35/DSDT.thread-count" , -"tests/data/acpi/x86/q35/DSDT.thread-count2" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , -"tests/data/acpi/x86/q35/DSDT.type4-count" , -"tests/data/acpi/x86/q35/DSDT.viot" , -"tests/data/acpi/x86/q35/DSDT.xapic",
Re: [RFC V3 PATCH 04/13] tests/qtest/bios-table-tests: Update ACPI table binaries for x86
Hi Gustavo,
Quoted 34 lines · Gustavo Romero
Hi Annie,
Quoted 16 lines · Annie Li
Following is the diff generated by the step 5 and 6 in
tests/qtest/bios-tables-test.cDiff from iasl to show changes in DSDT table:
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +0
-1@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34Quoted 2 lines
2025
+ * Disassembly of/tmp/aml-EMBW42, Wed Apr 9 19:04:34 2025This complete valid diff in the commit message seems to confuse git am and b4. Please remove the initial 2 lines to make it invalid, i.e. remove:
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000
Quoted 2 lines
tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +0
-0Also, to me, it's simple to concat:
Quoted 3 lines
- * Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025
+ * Disassembly of/tmp/aml-EMBW42, Wed Apr 9 19:04:34 2025
Quoted 5 lines
into:
Quoted 1 line
* Disassembly of tests/data/acpi/x86/q35/DSDT, Wed Apr 9 19:04:34 2025
since
/tmp/aml-EMBW42brings no information to the commit message.
Sure, will fix comments as suggestions above.
Thanks
Annie
Quoted 653 lines
Otherwise:
Reviewed-by Gustavo Romero <[email protected]>Cheers,
GustavoQuoted 642 lines
*
* Original Table Header:
* Signature "DSDT"
- * Length0x000020F8(8440)
+ * Length0x00002166(8550)
* Revision0x01**** 32-bit table (V1), no 64-bit math support
- * Checksum0xBE
+ * Checksum0x1E
* OEM ID "BOCHS "
* OEM Table ID "BXPC "
* OEM Revision0x00000001(1)
* Compiler ID "BXPC"
* Compiler Version0x00000001(1)
*/
DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ",0x00000001) {
Scope (\)
{
OperationRegion (DBG, SystemIO,0x0402, One)
Field (DBG, ByteAcc, NoLock, Preserve)
{
DBGB, 8
}tmp/asl-5XBW42.dsl 2025-04-09 19:04:34.839646378 +0000 renamed from tmp/asl-34PV42.dsl 2025-04-09 19:04:34.846646690 +0000 +0
-0@@ -2852,32 +2852,57 @@ { Memory32Fixed (ReadOnly,0xFED00000, // Address Base 0x00000400, // Address Length )
})
}
}Scope (
_GPE)
{
Name (_HID, "ACPI0006" /* GPE Block Device */) //_HID: Hardware ID }Scope (
_SB)
{
+ Device (SLPB)
+ {
+ Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device
*/) //_HID: Hardware ID
+ OperationRegion (\SLP, SystemIO,0x0201, One)
+ Field (\SLP, ByteAcc, NoLock, WriteAsZeros)
+ {
+ SBP, 1
+ }
+ }
+ }
+
+ Scope (\_GPE)
+ {
+ Method (_L07, 0, NotSerialized) //_Lxx: Level-Triggered
GPE, xx=0x00-0xFF
+ {
+ If (\_SB.SLPB.SBP)
+ {
+ \_SB.SLPB.SBP = One
+ Notify (\_SB.SLPB,0x80) // Status Change
+ }
+ }
+ }
+
+ Scope (_SB)
+ {
Device (\_SB.PCI0.PRES)
{
Name (_HID, EisaId ("PNP0A06") /* Generic Container Device */) //_HID: Hardware ID Name (_UID, "CPU Hotplug resources") //_UID: Unique ID
Mutex (CPLK,0x00)
Name (_CRS, ResourceTemplate () //_CRS: Current Resource Settings {
IO (Decode16,
0x0CD8, // Range Minimum
0x0CD8, // Range Maximum
0x01, // Alignment
0x0C, // Length
)
})
OperationRegion (PRST, SystemIO,0x0CD8,0x0C)
Field (PRST, ByteAcc, NoLock, WriteAsZeros)Signed-off-by Annie Li <[email protected]>---
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 tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------43 files changed, 42 deletions(-)tests/data/acpi/x86/pc/DSDT binary +0
-0tests/data/acpi/x86/pc/DSDT.acpierst binary +0
-0tests/data/acpi/x86/pc/DSDT.acpihmat binary +0
-0tests/data/acpi/x86/pc/DSDT.bridge binary +0
-0tests/data/acpi/x86/pc/DSDT.cphp binary +0
-0tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0
-0tests/data/acpi/x86/pc/DSDT.hpbridge binary +0
-0tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0
-0tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0
-0tests/data/acpi/x86/pc/DSDT.memhp binary +0
-0tests/data/acpi/x86/pc/DSDT.nohpet binary +0
-0tests/data/acpi/x86/pc/DSDT.numamem binary +0
-0tests/data/acpi/x86/pc/DSDT.roothp binary +0
-0tests/data/acpi/x86/q35/DSDT binary +0
-0tests/data/acpi/x86/q35/DSDT.acpierst binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0
-0tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0
-0tests/data/acpi/x86/q35/DSDT.applesmc binary +0
-0tests/data/acpi/x86/q35/DSDT.bridge binary +0
-0tests/data/acpi/x86/q35/DSDT.core-count binary +0
-0tests/data/acpi/x86/q35/DSDT.core-count2 binary +0
-0tests/data/acpi/x86/q35/DSDT.cphp binary +0
-0tests/data/acpi/x86/q35/DSDT.cxl binary +0
-0tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0
-0tests/data/acpi/x86/q35/DSDT.ipmibt binary +0
-0tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0
-0tests/data/acpi/x86/q35/DSDT.ivrs binary +0
-0tests/data/acpi/x86/q35/DSDT.memhp binary +0
-0tests/data/acpi/x86/q35/DSDT.mmio64 binary +0
-0tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0
-0tests/data/acpi/x86/q35/DSDT.noacpihp binary +0
-0tests/data/acpi/x86/q35/DSDT.nohpet binary +0
-0tests/data/acpi/x86/q35/DSDT.numamem binary +0
-0tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0
-0tests/data/acpi/x86/q35/DSDT.thread-count binary +0
-0tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0
-0tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0
-0tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0
-0tests/data/acpi/x86/q35/DSDT.type4-count binary +0
-0tests/data/acpi/x86/q35/DSDT.viot binary +0
-0tests/data/acpi/x86/q35/DSDT.xapic binary +0
-0tests/qtest/bios-tables-test-allowed-diff.h +0
-42@@ -1,43 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT" , -"tests/data/acpi/x86/pc/DSDT.acpierst" , -"tests/data/acpi/x86/pc/DSDT.acpihmat" , -"tests/data/acpi/x86/pc/DSDT.bridge" , -"tests/data/acpi/x86/pc/DSDT.cphp" , -"tests/data/acpi/x86/pc/DSDT.dimmpxm" , -"tests/data/acpi/x86/pc/DSDT.hpbridge" , -"tests/data/acpi/x86/pc/DSDT.hpbrroot" , -"tests/data/acpi/x86/pc/DSDT.ipmikcs" , -"tests/data/acpi/x86/pc/DSDT.memhp" , -"tests/data/acpi/x86/pc/DSDT.nohpet" , -"tests/data/acpi/x86/pc/DSDT.numamem" , -"tests/data/acpi/x86/pc/DSDT.roothp" , -"tests/data/acpi/x86/q35/DSDT" , -"tests/data/acpi/x86/q35/DSDT.acpierst" , -"tests/data/acpi/x86/q35/DSDT.acpihmat" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/x86/q35/DSDT.applesmc" , -"tests/data/acpi/x86/q35/DSDT.bridge" , -"tests/data/acpi/x86/q35/DSDT.core-count" , -"tests/data/acpi/x86/q35/DSDT.core-count2" , -"tests/data/acpi/x86/q35/DSDT.cphp" , -"tests/data/acpi/x86/q35/DSDT.cxl" , -"tests/data/acpi/x86/q35/DSDT.dimmpxm" , -"tests/data/acpi/x86/q35/DSDT.ipmibt" , -"tests/data/acpi/x86/q35/DSDT.ipmismbus" , -"tests/data/acpi/x86/q35/DSDT.ivrs" , -"tests/data/acpi/x86/q35/DSDT.memhp" , -"tests/data/acpi/x86/q35/DSDT.mmio64" , -"tests/data/acpi/x86/q35/DSDT.multi-bridge" , -"tests/data/acpi/x86/q35/DSDT.noacpihp" , -"tests/data/acpi/x86/q35/DSDT.nohpet" , -"tests/data/acpi/x86/q35/DSDT.numamem" , -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/x86/q35/DSDT.thread-count" , -"tests/data/acpi/x86/q35/DSDT.thread-count2" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , -"tests/data/acpi/x86/q35/DSDT.type4-count" , -"tests/data/acpi/x86/q35/DSDT.viot" , -"tests/data/acpi/x86/q35/DSDT.xapic",
RFC PATCH v3 5/13 acpi: Send the GPE event of suspend and wakeup for x86
In reply to Annie LiThe GPE event is triggered to notify x86 guest to suppend itself. The function acpi_send_sleep_event will also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.
--- hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 1 + 3 files changed, 12 insertions(+)
hw/acpi/core.c +10 -0
@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)return -1 ; } +void acpi_send_sleep_event (void ) +{ +Object *obj =object_resolve_path_type ("" ,TYPE_ACPI_DEVICE_IF ,NULL ); + +if (obj) { +/* Send sleep event */ +acpi_send_event (DEVICE (obj),ACPI_SLEEP_STATUS ); + } +} +static void acpi_notify_wakeup (Notifier *notifier,void *data) {ACPIREGS *ar =container_of (notifier,ACPIREGS , wakeup);
include/hw/acpi/acpi.h +1 -0
@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status); +void acpi_send_sleep_event (void );void acpi_update_sci (ACPIREGS *acpi_regs,qemu_irq irq);
include/hw/acpi/acpi_dev_interface.h +1 -0
@@ -13,6 +13,7 @@ typedef enum {ACPI_NVDIMM_HOTPLUG_STATUS =16 ,ACPI_VMGENID_CHANGE_STATUS =32 ,ACPI_POWER_DOWN_STATUS =64 , +ACPI_SLEEP_STATUS =128 , } AcpiEventStatusBits;#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Quoted 17 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>--- hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 1 + 3 files changed, 12 insertions(+)hw/acpi/core.c +0
-0
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 365
Quoted 7 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)return -1 ; } +void acpi_send_sleep_event (void ) +{ +Object *obj =object_resolve_path_type ("" ,TYPE_ACPI_DEVICE_IF ,NULL );
Is it a fair assumption there will only ever be one QOM object that provides the TYPE_ACPI_DEVICE_IF interface on a system?
Quoted 34 lines
hw/acpi/core.c +7
-0+ +if (obj) { +/* Send sleep event */ +acpi_send_event (DEVICE (obj),ACPI_SLEEP_STATUS ); + } +} +static void acpi_notify_wakeup (Notifier *notifier,void *data) {ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status); +void acpi_send_sleep_event (void );void acpi_update_sci (ACPIREGS *acpi_regs,qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum {ACPI_NVDIMM_HOTPLUG_STATUS =16 ,ACPI_VMGENID_CHANGE_STATUS =32 ,ACPI_POWER_DOWN_STATUS =64 , +ACPI_SLEEP_STATUS =128 , } AcpiEventStatusBits;#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Quoted 22 lines · Alex Bennée
Quoted 20 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>--- hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 1 + 3 files changed, 12 insertions(+)hw/acpi/core.c +0
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)return -1 ; }
Quoted 6 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem)
Quoted 4 lines
hw/acpi/core.c +3
-0+void acpi_send_sleep_event (void ) +{ +Object *obj =object_resolve_path_type ("" ,TYPE_ACPI_DEVICE_IF ,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
Thanks
Annie
Quoted 34 lines
Quoted 34 lines
hw/acpi/core.c +7
-0+ +if (obj) { +/* Send sleep event */ +acpi_send_event (DEVICE (obj),ACPI_SLEEP_STATUS ); + } +} +static void acpi_notify_wakeup (Notifier *notifier,void *data) {ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status); +void acpi_send_sleep_event (void );void acpi_update_sci (ACPIREGS *acpi_regs,qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum {ACPI_NVDIMM_HOTPLUG_STATUS =16 ,ACPI_VMGENID_CHANGE_STATUS =32 ,ACPI_POWER_DOWN_STATUS =64 , +ACPI_SLEEP_STATUS =128 , } AcpiEventStatusBits;#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Hi Annie,
Quoted 30 lines · Annie Li
Quoted 14 lines · Alex Bennée
Quoted 12 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)Quoted 13 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 364
Quoted 11 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event (void ) +{ + Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?
Quoted 1 line
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
/**
* object_resolve_path_type:
* @path: the path to resolve
* @typename: the type to look for.
* @ambiguous: (out) (optional): location to store whether the
* lookup failed because it was ambiguous, or %NULL.
* Set to %false on success.
Since you use ambiguous=NULL, your code will only set %obj if there is exactly ONE device implementing the ACPI_DEVICE interface created.
So far IIUC nothing forbids creating multiple ones, so if you expect only one, you should add code to handle the "2 or more" case. Or at least add a comment.
Regards,
Phil.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
hw/acpi/core.c +7
-0+ + if (obj) { + /* Send sleep event */ + acpi_send_event(DEVICE(obj), ACPI_SLEEP_STATUS); + } +} + static void acpi_notify_wakeup(Notifier *notifier, void *data) { ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr); void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq, AcpiEventStatusBits status); +void acpi_send_sleep_event (void ); void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum { ACPI_NVDIMM_HOTPLUG_STATUS = 16, ACPI_VMGENID_CHANGE_STATUS = 32, ACPI_POWER_DOWN_STATUS = 64, + ACPI_SLEEP_STATUS = 128, } AcpiEventStatusBits; #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Quoted 43 lines · Philippe Mathieu-Daudé
Hi Annie,
Quoted 30 lines · Annie Li
Quoted 14 lines · Alex Bennée
Quoted 12 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)Quoted 13 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 364
Quoted 11 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event (void ) +{ + Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?Quoted 1 line
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
/**
*object_resolve_path_type:
* @path: the path to resolve
* @typename: the type to look for.
* @ambiguous: (out) (optional): location to store whether the * lookup failed because it was ambiguous, or %NULL. * Set to %false on success.
Quoted 6 lines
Since you use ambiguous=NULL, your code will only set %obj if there is exactly ONE device implementing the
ACPI_DEVICEinterface created.So far IIUC nothing forbids creating multiple ones, so if you expect only one, you should add code to handle the "2 or more" case. Or at least add a comment.
Actually, there is only one QOM object here.
There are 3 classes involves with TYPE_ACPI_DEVICE_IF interface.
PC, Q35, GED.
For x86 system, the PC or Q35 machine doesn't use GED event, instead, it sends the GPE event.
For microvm/ARM/virt system, GED device is used, its own TYPE_ACPI_DEVICE_IF is involved.
All these objects do not exist at the same time, so it is safe to assume only one QOM object exists here.
Thanks
Annie
Quoted 37 lines
Regards,
Phil.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
hw/acpi/core.c +7
-0+ + if (obj) { + /* Send sleep event */ + acpi_send_event(DEVICE(obj), ACPI_SLEEP_STATUS); + } +} + static void acpi_notify_wakeup(Notifier *notifier, void *data) { ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr); void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq, AcpiEventStatusBits status); +void acpi_send_sleep_event (void ); void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum { ACPI_NVDIMM_HOTPLUG_STATUS = 16, ACPI_VMGENID_CHANGE_STATUS = 32, ACPI_POWER_DOWN_STATUS = 64, + ACPI_SLEEP_STATUS = 128, } AcpiEventStatusBits; #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Quoted 51 lines · Annie Li
Quoted 43 lines · Philippe Mathieu-Daudé
Hi Annie,
Quoted 30 lines · Annie Li
Quoted 14 lines · Alex Bennée
Quoted 12 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)Quoted 13 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 364
Quoted 11 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event (void ) +{ + Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?Quoted 1 line
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
/**
*object_resolve_path_type:
* @path: the path to resolve
* @typename: the type to look for.
* @ambiguous: (out) (optional): location to store whether the * lookup failed because it was ambiguous, or %NULL. * Set to %false on success.Quoted 6 lines
Since you use ambiguous=NULL, your code will only set %obj if there is exactly ONE device implementing the
ACPI_DEVICEinterface created.So far IIUC nothing forbids creating multiple ones, so if you expect only one, you should add code to handle the "2 or more" case. Or at least add a comment.
Quoted 9 lines
Actually, there is only one QOM object here.
There are 3 classes involves withTYPE_ACPI_DEVICE_IFinterface.
PC, Q35, GED.
For x86 system, the PC or Q35 machine doesn't use GED event, instead, it sends the GPE event.
For microvm/ARM/virt system, GED device is used, its ownTYPE_ACPI_DEVICE_IFis involved.
All these objects do not exist at the same time, so it is safe to assume only one QOM object exists here.
I agree this is the case as of today, but I'm not sure about tomorrow. AFAICT nothing prohibit instanciating more than 1 type implementing TYPE_ACPI_DEVICE_IF.
Anyway we are just trying to be more cautious here; up to the maintainer.
Regards,
Phil.
Quoted 40 lines
Thanks
AnnieQuoted 37 lines
Regards,
Phil.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
hw/acpi/core.c +7
-0+ + if (obj) { + /* Send sleep event */ + acpi_send_event(DEVICE(obj), ACPI_SLEEP_STATUS); + } +} + static void acpi_notify_wakeup(Notifier *notifier, void *data) { ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr); void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq, AcpiEventStatusBits status); +void acpi_send_sleep_event (void ); void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum { ACPI_NVDIMM_HOTPLUG_STATUS = 16, ACPI_VMGENID_CHANGE_STATUS = 32, ACPI_POWER_DOWN_STATUS = 64, + ACPI_SLEEP_STATUS = 128, } AcpiEventStatusBits; #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Hi Annie,
Quoted 62 lines · Philippe Mathieu-Daudé
Quoted 51 lines · Annie Li
Quoted 43 lines · Philippe Mathieu-Daudé
Hi Annie,
Quoted 30 lines · Annie Li
Quoted 14 lines · Alex Bennée
Quoted 12 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)Quoted 13 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 364
Quoted 11 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event (void ) +{ + Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?Quoted 1 line
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
/**
*object_resolve_path_type:
* @path: the path to resolve
* @typename: the type to look for.
* @ambiguous: (out) (optional): location to store whether the * lookup failed because it was ambiguous, or %NULL. * Set to %false on success.Quoted 6 lines
Since you use ambiguous=NULL, your code will only set %obj if there is exactly ONE device implementing the
ACPI_DEVICEinterface created.So far IIUC nothing forbids creating multiple ones, so if you expect only one, you should add code to handle the "2 or more" case. Or at least add a comment.
Quoted 9 lines
Actually, there is only one QOM object here.
There are 3 classes involves withTYPE_ACPI_DEVICE_IFinterface.
PC, Q35, GED.
For x86 system, the PC or Q35 machine doesn't use GED event, instead, it sends the GPE event.
For microvm/ARM/virt system, GED device is used, its ownTYPE_ACPI_DEVICE_IFis involved.
All these objects do not exist at the same time, so it is safe to assume only one QOM object exists here.
Quoted 6 lines
I agree this is the case as of today, but I'm not sure about tomorrow. AFAICT nothing prohibit instanciating more than 1 type implementing
TYPE_ACPI_DEVICE_IF.Anyway we are just trying to be more cautious here; up to the maintainer.
Annie, very soon probably the GPEX device will use the TYPE_ACPI_DEVICE_IF as well. GPEX is used in Arm machines (like "virt") and due to the support for ACPI PCI hotplug, which needs to be routed through the PCIe controller's hotplug handlers and the ACPI pcihp device before the hotplug event is finally delivered to the OS via the GED device, it also will use this ACPI interface.
I can think of something when adding the ACPI PCI hotplug support on machine with GPEX, but even for future cases, could you please add at least a check for the ambiguity and assert for no ambiguity here?
I suspect the only case we can have an ambiguity is when we have a device that needs to do something more complex and then deliver an event via GED, so specifically here for the sleep button I think it's ok to, in case of ambiguity, select the GED device by default.
Cheers,
Gustavo
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Hi Gustavo,
Quoted 70 lines · Gustavo Romero
Hi Annie,
Quoted 67 lines · Philippe Mathieu-Daudé
Quoted 52 lines · Annie Li
Quoted 44 lines · Philippe Mathieu-Daudé
Hi Annie,
Quoted 31 lines · Annie Li
Quoted 14 lines · Alex Bennée
Quoted 12 lines · Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)Quoted 14 lines
hw/acpi/core.c int acpi_get_slic_oem(AcpiSlicOem *oem) · line 365
Quoted 12 lines
hw/acpi/core.c +3
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event (void ) +{ + Object *obj = object_resolve_path_type("",TYPE_ACPI_DEVICE_IF ,NULL );Is it a fair assumption there will only ever be one QOM object that provides the
TYPE_ACPI_DEVICE_IFinterface on a system?Quoted 1 line
I supposed it was, but I might be wrong(seeing some classes have the same interface). Please correct me if I've missed something, thank you!
/**
*object_resolve_path_type:
* @path: the path to resolve
* @typename: the type to look for.
* @ambiguous: (out) (optional): location to store whether the * lookup failed because it was ambiguous, or %NULL. * Set to %false on success.Quoted 6 lines
Since you use ambiguous=NULL, your code will only set %obj if there is exactly ONE device implementing the
ACPI_DEVICEinterface created.So far IIUC nothing forbids creating multiple ones, so if you expect only one, you should add code to handle the "2 or more" case. Or at least add a comment.
Quoted 9 lines
Actually, there is only one QOM object here.
There are 3 classes involves withTYPE_ACPI_DEVICE_IFinterface.
PC, Q35, GED.
For x86 system, the PC or Q35 machine doesn't use GED event, instead, it sends the GPE event.
For microvm/ARM/virt system, GED device is used, its ownTYPE_ACPI_DEVICE_IFis involved.
All these objects do not exist at the same time, so it is safe to assume only one QOM object exists here.I agree this is the case as of today, but I'm not sure about tomorrow. AFAICT nothing prohibit instanciating more than 1 type implementing
TYPE_ACPI_DEVICE_IF.
Quoted 8 lines
Quoted 2 lines
Anyway we are just trying to be more cautious here; up to the maintainer.
Annie, very soon probably the GPEX device will use the
TYPE_ACPI_DEVICE_IFas well. GPEX is used in Arm machines (like "virt") and due to the support for ACPI PCI hotplug, which needs to be routed through the PCIe controller's hotplug handlers and the ACPI pcihp device before the hotplug event is finally delivered to the OS via the GED device, it also will use this ACPI interface.
Thanks for the info.
Quoted 4 lines
I can think of something when adding the ACPI PCI hotplug support on machine with GPEX, but even for future cases, could you please add at least a check for the ambiguity and assert for no ambiguity here?
Sure, will do the change similar to the following,
+bool ambiguous;
+Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, &ambiguous); +assert(!ambiguous);
Quoted 5 lines
I suspect the only case we can have an ambiguity is when we have a device that needs to do something more complex and then deliver an event via GED, so specifically here for the sleep button I think it's ok to, in case of ambiguity, select the GED device by default.
Nod
Thanks
Annie
Quoted 4 lines
Cheers,
Gustavo
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
In reply to Annie LiHi Annie,
Some additional comments I forgot :)
Quoted 1 line · Annie Li
The GPE event is triggered to notify x86 guest to suppend
nit ^ suspend
But I prefer to stick with "sleep" here instead.
Quoted 3 lines
itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.
The title for this patch is a bit misleading because no x86 code is actually touched. Also, we are not generating the AML code and field for wake up (SBW) in patch 1/13, hence, remove "wakeup" from the title as well?
Cheers,
Gustavo
Quoted 52 lines
Signed-off-by Annie Li <[email protected]>--- hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 1 + 3 files changed, 12 insertions(+)hw/acpi/core.c +10
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)return -1 ; } +void acpi_send_sleep_event (void ) +{ +Object *obj =object_resolve_path_type ("" ,TYPE_ACPI_DEVICE_IF ,NULL ); + +if (obj) { +/* Send sleep event */ +acpi_send_event (DEVICE (obj),ACPI_SLEEP_STATUS ); + } +} +static void acpi_notify_wakeup (Notifier *notifier,void *data) {ACPIREGS *ar =container_of (notifier,ACPIREGS , wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status); +void acpi_send_sleep_event (void );void acpi_update_sci (ACPIREGS *acpi_regs,qemu_irq irq);include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum {ACPI_NVDIMM_HOTPLUG_STATUS =16 ,ACPI_VMGENID_CHANGE_STATUS =32 ,ACPI_POWER_DOWN_STATUS =64 , +ACPI_SLEEP_STATUS =128 , } AcpiEventStatusBits;#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86
Hi Gustavo,
Quoted 11 lines · Gustavo Romero
Hi Annie,
Some additional comments I forgot :)
Quoted 1 line · Annie Li
The GPE event is triggered to notify x86 guest to suppend
nit ^ suspend
But I prefer to stick with "sleep" here instead.
Ack
Quoted 10 lines
Quoted 5 lines
itself. The function
acpi_send_sleep_eventwill also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported.The title for this patch is a bit misleading because no x86 code is actually touched. Also, we are not generating the AML code and field for wake up (SBW) in patch 1/13, hence, remove "wakeup" from the title as well?
Good catch, I've removed "wakeup" from comments, but missed this in the title :)
Thanks
Annie
Quoted 55 lines
Cheers,
GustavoQuoted 49 lines
Signed-off-by Annie Li <[email protected]>---
hw/acpi/core.c | 10 ++++++++++ include/hw/acpi/acpi.h | 1 +include/hw/acpi/acpi_dev_interface.h| 1 +3 files changed, 12 insertions(+)hw/acpi/core.c +9
-0@@ -359,6 +359,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem) return -1; } +void acpi_send_sleep_event(void) +{ + Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF,NULL ); + + if (obj) { + /* Send sleep event */ + acpi_send_event(DEVICE(obj), ACPI_SLEEP_STATUS); + } +} + static void acpi_notify_wakeup(Notifier *notifier, void *data) {ACPIREGS *ar =
container_of(notifier, ACPIREGS, wakeup);include/hw/acpi/acpi.h +1
-0@@ -184,6 +184,7 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr); void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq, AcpiEventStatusBits status); +void acpi_send_sleep_event (void ); void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);diff --git
a/include/hw/acpi/acpi_dev_interface.hb/include/hw/acpi/acpi_dev_interface.hindex68d9d15f50..1cb050cd3a100644include/hw/acpi/acpi_dev_interface.h +1
-0@@ -13,6 +13,7 @@ typedef enum { ACPI_NVDIMM_HOTPLUG_STATUS = 16, ACPI_VMGENID_CHANGE_STATUS = 32, ACPI_POWER_DOWN_STATUS = 64, + ACPI_SLEEP_STATUS = 128, } AcpiEventStatusBits; #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
RFC PATCH v3 6/13 test/acpi: allow DSDT table changes for microvm
In reply to Annie Lilist changed files in tests/qtest/bios-tables-test-allowed-diff.h
--- tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 1 file changed, 5 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +5 -0
@@ -1 +1,6 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/microvm/DSDT" , +"tests/data/acpi/x86/microvm/DSDT.ioapic2" , +"tests/data/acpi/x86/microvm/DSDT.pcie" , +"tests/data/acpi/x86/microvm/DSDT.rtc" , +"tests/data/acpi/x86/microvm/DSDT.usb",
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 06/13] test/acpi: allow DSDT table changes for microvm
Annie,
Quoted 1 line · Annie Li
list changed files in
tests/qtest/bios-tables-test-allowed-diff.h
nit: List
Quoted 10 lines
Signed-off-by Annie Li <[email protected]>--- tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++ 1 file changed, 5 insertions(+)tests/qtest/bios-tables-test-allowed-diff.h +0
-0
tests/qtest/bios-tables-test-allowed-diff.h line 6
Quoted 6 lines
tests/qtest/bios-tables-test-allowed-diff.h +5
-0@@ -1 +1,6 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/microvm/DSDT" , +"tests/data/acpi/x86/microvm/DSDT.ioapic2" , +"tests/data/acpi/x86/microvm/DSDT.pcie" , +"tests/data/acpi/x86/microvm/DSDT.rtc" , +"tests/data/acpi/x86/microvm/DSDT.usb",
Cheers,
Gustavo
Re: [RFC V3 PATCH 06/13] test/acpi: allow DSDT table changes for microvm
Hi Gustavo,
Quoted 6 lines · Gustavo Romero
Annie,
Quoted 1 line · Annie Li
list changed files in
tests/qtest/bios-tables-test-allowed-diff.hnit: List
Good catch, will fix it.
Annie
Quoted 24 lines
Quoted 12 lines
Signed-off-by Annie Li <[email protected]>---
tests/qtest/bios-tables-test-allowed-diff.h| 5 +++++1 file changed, 5 insertions(+)tests/qtest/bios-tables-test-allowed-diff.h +0
-0tests/qtest/bios-tables-test-allowed-diff.h line 6
Quoted 6 lines
tests/qtest/bios-tables-test-allowed-diff.h +5
-0@@ -1 +1,6 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/microvm/DSDT" , +"tests/data/acpi/x86/microvm/DSDT.ioapic2" , +"tests/data/acpi/x86/microvm/DSDT.pcie" , +"tests/data/acpi/x86/microvm/DSDT.rtc" , +"tests/data/acpi/x86/microvm/DSDT.usb",Reviewed-by Gustavo Romero <[email protected]>Cheers,
Gustavo
RFC PATCH v3 7/13 microvm: support control method sleep button
In reply to Annie LiAdd the support of control method sleep button and System S3 Sleeping State for microvm.
--- hw/i386/acpi-microvm.c | 11 +++++++++++ include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 12 insertions(+)
hw/i386/acpi-microvm.c +11 -0
@@ -32,6 +32,7 @@#include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" #include "hw/acpi/erst.h" +#include "hw/acpi/control_method_device.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h"
@@ -123,12 +124,22 @@ build_dsdt_microvm(GArray *table_data, BIOSLinker *linker,build_ged_aml (sb_scope,GED_DEVICE , x86ms->acpi_dev,GED_MMIO_IRQ ,AML_SYSTEM_MEMORY ,GED_MMIO_BASE );acpi_dsdt_add_power_button (sb_scope); +acpi_dsdt_add_sleep_button (sb_scope);acpi_dsdt_add_virtio (sb_scope, mms);acpi_dsdt_add_xhci (sb_scope, mms);acpi_dsdt_add_pci (sb_scope, mms);aml_append (dsdt, sb_scope);/* ACPI 5.0: Table 7-209 System State Package */ + scope =aml_scope ("\\" ); + pkg =aml_package (4 ); +aml_append (pkg,aml_int (ACPI_GED_SLP_TYP_S3 )); +aml_append (pkg,aml_int (0 ));/* ignored */ +aml_append (pkg,aml_int (0 ));/* reserved */ +aml_append (pkg,aml_int (0 ));/* reserved */ +aml_append (scope,aml_name_decl ("_S3" , pkg)); +aml_append (dsdt, scope); + scope =aml_scope ("\\" ); pkg =aml_package (4 );aml_append (pkg,aml_int (ACPI_GED_SLP_TYP_S5 ));
include/hw/acpi/generic_event_device.h +1 -0
@@ -85,6 +85,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)#define ACPI_GED_SLP_TYP_POS 0x2/* SLP_TYPx Bit Offset */ #define ACPI_GED_SLP_TYP_MASK 0x07/* SLP_TYPx 3-bit mask */ #define ACPI_GED_SLP_TYP_S5 0x05/* System _S5 State (Soft Off) */ +#define ACPI_GED_SLP_TYP_S3 0x03/* System _S3 State (Sleeping State) */ #define ACPI_GED_SLP_EN 0x20/* SLP_EN write-only bit */ #define GED_DEVICE "GED"
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 07/13] microvm: support control method sleep button
Hi Annie,
Quoted 2 lines · Annie Li
Add the support of control method sleep button and System S3 Sleeping State for microvm.
I would say "... of ACPI Control Method Sleeping Button ...¨, the important part being "ACPI" to make clear what's the context of the support. Because such a device requires also some plumbing in QEMU code to really be "supported".
For the title, maybe smth like: "microvm: Add ACPI sleeping button device"
Quoted 19 lines
Signed-off-by Annie Li <[email protected]>--- hw/i386/acpi-microvm.c | 11 +++++++++++ include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 12 insertions(+)hw/i386/acpi-microvm.c +1
-0@@ -32,6 +32,7 @@#include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" #include "hw/acpi/erst.h" +#include "hw/acpi/control_method_device.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h"
hw/i386/acpi-microvm.c build_dsdt_microvm(GArray *table_data, BIOSLinker *linker, · line 133
Quoted 10 lines
hw/i386/acpi-microvm.c +1
-0@@ -123,12 +124,22 @@ build_dsdt_microvm(GArray *table_data, BIOSLinker *linker,build_ged_aml (sb_scope,GED_DEVICE , x86ms->acpi_dev,GED_MMIO_IRQ ,AML_SYSTEM_MEMORY ,GED_MMIO_BASE );acpi_dsdt_add_power_button (sb_scope); +acpi_dsdt_add_sleep_button (sb_scope);acpi_dsdt_add_virtio (sb_scope, mms);acpi_dsdt_add_xhci (sb_scope, mms);acpi_dsdt_add_pci (sb_scope, mms);aml_append (dsdt, sb_scope);/* ACPI 5.0: Table 7-209 System State Package */
Should this be "Table 7-205"? Or even, why not:
"ACPI 6.5, Table 7.11: System State Package" ?
Cheers,
Gustavo
Quoted 24 lines
hw/i386/acpi-microvm.c +9
-0+ scope =aml_scope ("\\" ); + pkg =aml_package (4 ); +aml_append (pkg,aml_int (ACPI_GED_SLP_TYP_S3 )); +aml_append (pkg,aml_int (0 ));/* ignored */ +aml_append (pkg,aml_int (0 ));/* reserved */ +aml_append (pkg,aml_int (0 ));/* reserved */ +aml_append (scope,aml_name_decl ("_S3" , pkg)); +aml_append (dsdt, scope); + scope =aml_scope ("\\" ); pkg =aml_package (4 );aml_append (pkg,aml_int (ACPI_GED_SLP_TYP_S5 ));include/hw/acpi/generic_event_device.h +1
-0@@ -85,6 +85,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)#define ACPI_GED_SLP_TYP_POS 0x2/* SLP_TYPx Bit Offset */ #define ACPI_GED_SLP_TYP_MASK 0x07/* SLP_TYPx 3-bit mask */ #define ACPI_GED_SLP_TYP_S5 0x05/* System _S5 State (Soft Off) */ +#define ACPI_GED_SLP_TYP_S3 0x03/* System _S3 State (Sleeping State) */ #define ACPI_GED_SLP_EN 0x20/* SLP_EN write-only bit */ #define GED_DEVICE "GED"
Re: [RFC V3 PATCH 07/13] microvm: support control method sleep button
Hi Gustavo,
Quoted 6 lines · Gustavo Romero
Hi Annie,
Quoted 2 lines · Annie Li
Add the support of control method sleep button and System S3 Sleeping State for microvm.
Quoted 6 lines
I would say "... of ACPI Control Method Sleeping Button ...¨, the important part being "ACPI" to make clear what's the context of the support. Because such a device requires also some plumbing in QEMU code to really be "supported".
For the title, maybe smth like: "microvm: Add ACPI sleeping button device"
Ack
Quoted 34 lines
Quoted 21 lines
Signed-off-by Annie Li <[email protected]>---
hw/i386/acpi-microvm.c | 11 +++++++++++include/hw/acpi/generic_event_device.h| 1 +2 files changed, 12 insertions(+)hw/i386/acpi-microvm.c +1
-0@@ -32,6 +32,7 @@ #include "hw/acpi/generic_event_device.h" #include "hw/acpi/utils.h" #include "hw/acpi/erst.h" +#include "hw/acpi/control_method_device.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/microvm.h" #include "hw/pci/pci.h"hw/i386/acpi-microvm.c build_dsdt_microvm(GArray *table_data, · line 133
Quoted 10 lines
hw/i386/acpi-microvm.c +1
-0@@ -123,12 +124,22 @@ build_dsdt_microvm(GArray *table_data,BIOSLinker *linker, build_ged_aml(sb_scope, GED_DEVICE, x86ms->acpi_dev, GED_MMIO_IRQ, AML_SYSTEM_MEMORY, GED_MMIO_BASE); acpi_dsdt_add_power_button(sb_scope); + acpi_dsdt_add_sleep_button(sb_scope); acpi_dsdt_add_virtio(sb_scope, mms); acpi_dsdt_add_xhci(sb_scope, mms); acpi_dsdt_add_pci(sb_scope, mms); aml_append(dsdt, sb_scope); /* ACPI 5.0: Table 7-209 System State Package */Should this be "Table 7-205"? Or even, why not:
Quoted 1 line
"ACPI 6.5, Table 7.11: System State Package" ?
Agree. I should have updated the comments here also, this was kept from the existing code. Since the ACPI spec has been updated, the comments here should be updated also.
Thanks
Annie
Quoted 30 lines
Cheers,
GustavoQuoted 24 lines
hw/i386/acpi-microvm.c +9
-0+ scope = aml_scope("\\"); + pkg = aml_package(4); + aml_append(pkg, aml_int(ACPI_GED_SLP_TYP_S3)); + aml_append(pkg, aml_int(0)); /* ignored */ + aml_append(pkg, aml_int(0)); /* reserved */ + aml_append(pkg, aml_int(0)); /* reserved */ + aml_append(scope, aml_name_decl("_S3", pkg)); + aml_append(dsdt, scope); + scope = aml_scope("\\"); pkg = aml_package(4); aml_append(pkg, aml_int(ACPI_GED_SLP_TYP_S5));include/hw/acpi/generic_event_device.h +1
-0@@ -85,6 +85,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) #define ACPI_GED_SLP_TYP_POS 0x2 /* SLP_TYPx Bit Offset */ #define ACPI_GED_SLP_TYP_MASK 0x07 /* SLP_TYPx 3-bit mask */ #define ACPI_GED_SLP_TYP_S5 0x05 /* System _S5 State (Soft Off) */ +#define ACPI_GED_SLP_TYP_S3 0x03/* System _S3 State (Sleeping State) */
#define ACPI_GED_SLP_EN 0x20 /*SLP_ENwrite-only bit */ #define GED_DEVICE "GED"
RFC PATCH v3 8/13 hw/acpi: Add ACPI GED support for the sleep event
In reply to Annie LiFrom: Miguel Luis <[email protected]>
Add support for ACPI GED sleep event on the ACPI device interface so that HW-reduced systems can enable guests to sleep.
--- hw/acpi/generic_event_device.c | 9 +++++++++ include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 10 insertions(+)
hw/acpi/generic_event_device.c +9 -0
@@ -13,6 +13,7 @@#include "qapi/error.h" #include "hw/acpi/acpi.h" #include "hw/acpi/generic_event_device.h" +#include "hw/acpi/control_method_device.h" #include "hw/irq.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h"
@@ -26,6 +27,7 @@ static const uint32_t ged_supported_events[] = {ACPI_GED_PWR_DOWN_EVT ,ACPI_GED_NVDIMM_HOTPLUG_EVT ,ACPI_GED_CPU_HOTPLUG_EVT , + ACPI_GED_SLEEP_EVT, };/*
@@ -121,6 +123,11 @@ void build_ged_aml(Aml *table, const char *name, HotplugHandler *hotplug_dev,aml_notify (aml_name ("\\_SB.NVDR" ), aml_int(0x80)));break ; +case ACPI_GED_SLEEP_EVT : +aml_append (if_ctx, +aml_notify (aml_name (ACPI_SLEEP_BUTTON_DEVICE ), +aml_int (0x80 ))); +break ;default :/* * Please make sure all the events in ged_supported_events[]
@@ -295,6 +302,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) sel =ACPI_GED_MEM_HOTPLUG_EVT ; }else if (ev &ACPI_POWER_DOWN_STATUS ) { sel =ACPI_GED_PWR_DOWN_EVT ; + }else if (ev &ACPI_SLEEP_STATUS ) { + sel =ACPI_GED_SLEEP_EVT ; }else if (ev &ACPI_NVDIMM_HOTPLUG_STATUS ) { sel =ACPI_GED_NVDIMM_HOTPLUG_EVT ; }else if (ev &ACPI_CPU_HOTPLUG_STATUS ) {
include/hw/acpi/generic_event_device.h +1 -0
@@ -102,6 +102,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)#define ACPI_GED_PWR_DOWN_EVT 0x2#define ACPI_GED_NVDIMM_HOTPLUG_EVT 0x4#define ACPI_GED_CPU_HOTPLUG_EVT 0x8 +#define ACPI_GED_SLEEP_EVT 0x10 typedef struct GEDState { MemoryRegion evt;
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 08/13] hw/acpi: Add ACPI GED support for the sleep event
Hi Annie,
Quoted 59 lines · Annie Li
From: Miguel Luis <[email protected]>
Add support for ACPI GED sleep event on the ACPI device interface so that HW-reduced systems can enable guests to sleep.
Signed-off-by Miguel Luis <[email protected]>Signed-off-by Annie Li <[email protected]>--- hw/acpi/generic_event_device.c | 9 +++++++++ include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 10 insertions(+)hw/acpi/generic_event_device.c +9
-0@@ -13,6 +13,7 @@#include "qapi/error.h" #include "hw/acpi/acpi.h" #include "hw/acpi/generic_event_device.h" +#include "hw/acpi/control_method_device.h" #include "hw/irq.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" @@ -26,6 +27,7 @@ static const uint32_t ged_supported_events[] = {ACPI_GED_PWR_DOWN_EVT ,ACPI_GED_NVDIMM_HOTPLUG_EVT ,ACPI_GED_CPU_HOTPLUG_EVT , + ACPI_GED_SLEEP_EVT, };/* @@ -121,6 +123,11 @@ void build_ged_aml(Aml *table, const char *name, HotplugHandler *hotplug_dev,aml_notify (aml_name ("\\_SB.NVDR" ), aml_int(0x80)));break ; +case ACPI_GED_SLEEP_EVT : +aml_append (if_ctx, +aml_notify (aml_name (ACPI_SLEEP_BUTTON_DEVICE ), +aml_int (0x80 ))); +break ;default :/* * Please make sure all the events in ged_supported_events[] @@ -295,6 +302,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) sel =ACPI_GED_MEM_HOTPLUG_EVT ; }else if (ev &ACPI_POWER_DOWN_STATUS ) { sel =ACPI_GED_PWR_DOWN_EVT ; + }else if (ev &ACPI_SLEEP_STATUS ) { + sel =ACPI_GED_SLEEP_EVT ; }else if (ev &ACPI_NVDIMM_HOTPLUG_STATUS ) { sel =ACPI_GED_NVDIMM_HOTPLUG_EVT ; }else if (ev &ACPI_CPU_HOTPLUG_STATUS ) {include/hw/acpi/generic_event_device.h +0
-0
include/hw/acpi/generic_event_device.h OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) · line 108
Quoted 7 lines
include/hw/acpi/generic_event_device.h +1
-0@@ -102,6 +102,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)#define ACPI_GED_PWR_DOWN_EVT 0x2#define ACPI_GED_NVDIMM_HOTPLUG_EVT 0x4#define ACPI_GED_CPU_HOTPLUG_EVT 0x8 +#define ACPI_GED_SLEEP_EVT 0x10 typedef struct GEDState { MemoryRegion evt;
Cheers,
Gustavo
RFC PATCH v3 9/13 microvm: enable sleep GED event
In reply to Annie LiThe sleep GED event is enabled for MicroVM. Also, the system suspend is enabled when the GED register is set for sleep.
--- hw/i386/microvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/microvm.c +2 -1
@@ -205,7 +205,8 @@ static void microvm_devices_init(MicrovmMachineState *mms)/* Optional and legacy devices */ if (x86_machine_is_acpi_enabled (x86ms)) {DeviceState *dev =qdev_new (TYPE_ACPI_GED ); -qdev_prop_set_uint32 (dev,"ged-event" ,ACPI_GED_PWR_DOWN_EVT ); +qdev_prop_set_uint32 (dev,"ged-event" , +ACPI_GED_PWR_DOWN_EVT |ACPI_GED_SLEEP_EVT );sysbus_realize (SYS_BUS_DEVICE (dev), &error_fatal);sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,GED_MMIO_BASE );/* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 09/13] microvm: enable sleep GED event
Hi Annie,
Quoted 2 lines · Annie Li
The sleep GED event is enabled for MicroVM. Also, the system suspend is enabled when the GED register is set for sleep.
nit: in the commit messages, please stick with a single case for microvm (or MicroVM, etc).
Quoted 10 lines
Signed-off-by Annie Li <[email protected]>--- hw/i386/microvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)hw/i386/microvm.c +0
-0
hw/i386/microvm.c static void microvm_devices_init(MicrovmMachineState *mms) · line 212
Quoted 9 lines
hw/i386/microvm.c +2
-1@@ -205,7 +205,8 @@ static void microvm_devices_init(MicrovmMachineState *mms)/* Optional and legacy devices */ if (x86_machine_is_acpi_enabled (x86ms)) {DeviceState *dev =qdev_new (TYPE_ACPI_GED ); -qdev_prop_set_uint32 (dev,"ged-event" ,ACPI_GED_PWR_DOWN_EVT ); +qdev_prop_set_uint32 (dev,"ged-event" , +ACPI_GED_PWR_DOWN_EVT |ACPI_GED_SLEEP_EVT );sysbus_realize (SYS_BUS_DEVICE (dev), &error_fatal);sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,GED_MMIO_BASE );/* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */
Cheers,
Gustavo
Re: [RFC V3 PATCH 09/13] microvm: enable sleep GED event
Hi Gustavo,
Quoted 8 lines · Gustavo Romero
Hi Annie,
Quoted 2 lines · Annie Li
The sleep GED event is enabled for MicroVM. Also, the system suspend is enabled when the GED register is set for sleep.
nit: in the commit messages, please stick with a single case for microvm (or MicroVM, etc).
Will fix this.
Thanks for the review.
Annie
Quoted 29 lines
Quoted 21 lines
Signed-off-by Annie Li <[email protected]>---
hw/i386/microvm.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)hw/i386/microvm.c +2
-1@@ -205,7 +205,8 @@ static void microvm_devices_init(MicrovmMachineState *mms) /* Optional and legacy devices */ if (x86_machine_is_acpi_enabled(x86ms)) { DeviceState *dev = qdev_new(TYPE_ACPI_GED); - qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT); + qdev_prop_set_uint32(dev, "ged-event", + ACPI_GED_PWR_DOWN_EVT |ACPI_GED_SLEEP_EVT ); sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);Quoted 2 lines
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE); /*sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */Reviewed-by Gustavo Romero <[email protected]>Cheers,
Gustavo
RFC PATCH v3 10/13 tests/qtest/bios-table-tests: Update ACPI table binaries for microvm
In reply to Annie LiFollowing is the diff generated by the step 5 and 6 in tests/qtest/bios-tables-test.c
Diff from iasl to show changes in DSDT table:
tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 renamed from tmp/asl-2F0N42.dsl 2025-04-11 12:50:02.892883467 +0000 +29 -3
@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/microvm/DSDT, Fri Apr 11 12:50:02 2025 + * Disassembly of /tmp/aml-481N42, Fri Apr 11 12:50:02 2025 * * Original Table Header: * Signature "DSDT" - * Length 0x0000016D (365) + * Length 0x000001BA (442) * Revision 0x02 - * Checksum 0x11 + * Checksum 0xD5 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPC ", 0x00000001) { Scope (_SB) { Device (FWCF) { Name (_HID, "QEMU0002") // _HID: Hardware ID Name (_STA, 0x0B) // _STA: Status Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings {
@@ -66,56 +66,82 @@ 0x00000009, } }) OperationRegion (EREG, SystemMemory, 0xFEA00000, 0x04) Field (EREG, DWordAcc, NoLock, WriteAsZeros) { ESEL, 32 } Method (_EVT, 1, Serialized) // _EVT: Event { Local0 = ESEL /* \_SB_.GED_.ESEL */ If (((Local0 & 0x02) == 0x02)) { Notify (PWRB, 0x80) // Status Change } + + If (((Local0 & 0x10) == 0x10)) + { + Notify (SLPB, 0x80) // Status Change + } } } Device (PWRB) { Name (_HID, "PNP0C0C" /* Power Button Device */) // _HID: Hardware ID Name (_UID, Zero) // _UID: Unique ID } + Device (SLPB) + { + Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID + OperationRegion (\SLP, SystemIO, 0x0201, One) + Field (\SLP, ByteAcc, NoLock, WriteAsZeros) + { + SBP, 1 + } + } + Device (VR07) { Name (_HID, "LNRO0005") // _HID: Hardware ID Name (_UID, 0x07) // _UID: Unique ID Name (_CCA, One) // _CCA: Cache Coherency Attribute Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { Memory32Fixed (ReadWrite, 0xFEB00E00, // Address Base 0x00000200, // Address Length ) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) { 0x00000017, } }) } } Scope (\) { + Name (_S3, Package (0x04) // _S3_: S3 System State + { + 0x03, + Zero, + Zero, + Zero + }) + } + + Scope (\) + { Name (_S5, Package (0x04) // _S5_: S5 System State { 0x05, Zero, Zero, Zero }) } }
--- 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/qtest/bios-tables-test-allowed-diff.h | 5 ----- 6 files changed, 5 deletions(-)
tests/data/acpi/x86/microvm/DSDT binary +0 -0
tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0 -0
tests/data/acpi/x86/microvm/DSDT.pcie binary +0 -0
tests/data/acpi/x86/microvm/DSDT.rtc binary +0 -0
tests/data/acpi/x86/microvm/DSDT.usb binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
@@ -1,6 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/microvm/DSDT" , -"tests/data/acpi/x86/microvm/DSDT.ioapic2" , -"tests/data/acpi/x86/microvm/DSDT.pcie" , -"tests/data/acpi/x86/microvm/DSDT.rtc" , -"tests/data/acpi/x86/microvm/DSDT.usb",
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 10/13] tests/qtest/bios-table-tests: Update ACPI table binaries for microvm
Hi Annie,
Quoted 8 lines · Annie Li
Following is the diff generated by the step 5 and 6 in
tests/qtest/bios-tables-test.cDiff from iasl to show changes in DSDT table:
tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 line 8
Quoted 9 lines
tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 renamed from tmp/asl-2F0N42.dsl 2025-04-11 12:50:02.892883467 +0000 +1
-1@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/microvm/DSDT, Fri Apr 11 12:50:02 2025 + * Disassembly of /tmp/aml-481N42, Fri Apr 11 12:50:02 2025
Same comment from 4/13 regarding diff confusing git am and b4 and about the filename.
Otherwise:
Cheers,
Gustavo
Quoted 188 lines
tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 renamed from tmp/asl-2F0N42.dsl 2025-04-11 12:50:02.892883467 +0000 +28
-2* * Original Table Header: * Signature "DSDT" - * Length 0x0000016D (365) + * Length 0x000001BA (442) * Revision 0x02 - * Checksum 0x11 + * Checksum 0xD5 * OEM ID "BOCHS " * OEM Table ID "BXPC " * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPC ", 0x00000001) { Scope (_SB) { Device (FWCF) { Name (_HID, "QEMU0002") // _HID: Hardware ID Name (_STA, 0x0B) // _STA: Status Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings {@@ -66,56 +66,82 @@ 0x00000009, } }) OperationRegion (EREG, SystemMemory, 0xFEA00000, 0x04) Field (EREG, DWordAcc, NoLock, WriteAsZeros) { ESEL, 32 } Method (_EVT, 1, Serialized) // _EVT: Event { Local0 = ESEL /* \_SB_.GED_.ESEL */ If (((Local0 & 0x02) == 0x02)) { Notify (PWRB, 0x80) // Status Change } + + If (((Local0 & 0x10) == 0x10)) + { + Notify (SLPB, 0x80) // Status Change + } } } Device (PWRB) { Name (_HID, "PNP0C0C" /* Power Button Device */) // _HID: Hardware ID Name (_UID, Zero) // _UID: Unique ID } + Device (SLPB) + { + Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID + OperationRegion (\SLP, SystemIO, 0x0201, One) + Field (\SLP, ByteAcc, NoLock, WriteAsZeros) + { + SBP, 1 + } + } + Device (VR07) { Name (_HID, "LNRO0005") // _HID: Hardware ID Name (_UID, 0x07) // _UID: Unique ID Name (_CCA, One) // _CCA: Cache Coherency Attribute Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { Memory32Fixed (ReadWrite, 0xFEB00E00, // Address Base 0x00000200, // Address Length ) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) { 0x00000017, } }) } } Scope (\) { + Name (_S3, Package (0x04) // _S3_: S3 System State + { + 0x03, + Zero, + Zero, + Zero + }) + } + + Scope (\) + { Name (_S5, Package (0x04) // _S5_: S5 System State { 0x05, Zero, Zero, Zero }) } }Signed-off-by Annie Li <[email protected]>--- 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/qtest/bios-tables-test-allowed-diff.h | 5 ----- 6 files changed, 5 deletions(-)tests/data/acpi/x86/microvm/DSDT binary +0
-0tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0
-0tests/data/acpi/x86/microvm/DSDT.pcie binary +0
-0tests/data/acpi/x86/microvm/DSDT.rtc binary +0
-0tests/data/acpi/x86/microvm/DSDT.usb binary +0
-0tests/qtest/bios-tables-test-allowed-diff.h +0
-5@@ -1,6 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/microvm/DSDT" , -"tests/data/acpi/x86/microvm/DSDT.ioapic2" , -"tests/data/acpi/x86/microvm/DSDT.pcie" , -"tests/data/acpi/x86/microvm/DSDT.rtc" , -"tests/data/acpi/x86/microvm/DSDT.usb",
Re: [RFC V3 PATCH 10/13] tests/qtest/bios-table-tests: Update ACPI table binaries for microvm
Hi Gustavo,
Quoted 8 lines · Gustavo Romero
Hi Annie,
Quoted 5 lines · Annie Li
Following is the diff generated by the step 5 and 6 in
tests/qtest/bios-tables-test.cDiff from iasl to show changes in DSDT table:
Quoted 15 lines
Quoted 11 lines
tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 renamed from tmp/asl-2F0N42.dsl 2025-04-11 12:50:02.892883467 +0000 +0
-1@@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/x86/microvm/DSDT, Fri Apr 11Quoted 2 lines
12:50:02 2025
+ * Disassembly of/tmp/aml-481N42, Fri Apr 11 12:50:02 2025Same comment from 4/13 regarding diff confusing git am and b4 and about the filename.
Nod, will fix it.
Thanks
Annie
Quoted 199 lines
Otherwise:
Reviewed-by Gustavo Romero <[email protected]>Cheers,
GustavoQuoted 189 lines
*
* Original Table Header:
* Signature "DSDT"
- * Length0x0000016D(365)
+ * Length0x000001BA(442)
* Revision0x02
- * Checksum0x11
+ * Checksum0xD5
* OEM ID "BOCHS "
* OEM Table ID "BXPC "
* OEM Revision0x00000001(1)
* Compiler ID "BXPC"
* Compiler Version0x00000001(1)
*/
DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPC ",0x00000001) {
Scope (_SB)
{
Device (FWCF)
{
Name (_HID, "QEMU0002") //_HID: Hardware ID
Name (_STA, 0x0B) //_STA: Status
Name (_CRS, ResourceTemplate () //_CRS: Current Resource Settings {tmp/asl-C81N42.dsl 2025-04-11 12:50:02.890883378 +0000 renamed from tmp/asl-2F0N42.dsl 2025-04-11 12:50:02.892883467 +0000 +0
-0@@ -66,56 +66,82 @@ 0x00000009, } }) OperationRegion (EREG, SystemMemory, 0xFEA00000, 0x04) Field (EREG, DWordAcc, NoLock, WriteAsZeros) {ESEL, 32
}Method (
_EVT, 1, Serialized) //_EVT: Event {
Local0 = ESEL /* \_SB_.GED_.ESEL */ If (((Local0 &0x02) ==0x02)) {
Notify (PWRB,0x80) // Status Change }
+
+ If (((Local0 &0x10) ==0x10))
+ {
+ Notify (SLPB,0x80) // Status Change + }
}
}Device (PWRB)
{
Name (_HID, "PNP0C0C" /* Power Button Device */) //_HID: Hardware ID Name (_UID, Zero) //_UID: Unique ID
}+ Device (SLPB)
+ {
+ Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) //_HID: Hardware ID
+ OperationRegion (\SLP, SystemIO,0x0201, One)
+ Field (\SLP, ByteAcc, NoLock, WriteAsZeros)
+ {
+ SBP, 1
+ }
+ }
+
Device (VR07)
{
Name (_HID, "LNRO0005") //_HID: Hardware ID
Name (_UID, 0x07) //_UID: Unique ID
Name (_CCA, One) //_CCA: Cache Coherency Attribute Name (_CRS, ResourceTemplate () //_CRS: Current Resource Settings {
Memory32Fixed (ReadWrite,
0xFEB00E00, // Address Base 0x00000200, // Address Length
)
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) {
0x00000017,
}
})
}
}Scope (\)
{
+ Name (_S3, Package (0x04) // _S3_: S3 System State + {
+0x03,
+ Zero,
+ Zero,
+ Zero
+ })
+ }
+
+ Scope (\)
+ {
Name (_S5, Package (0x04) // _S5_: S5 System State {
0x05,
Zero,
Zero,
Zero
})
}
}Signed-off-by Annie Li <[email protected]>---
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 bytestests/qtest/bios-tables-test-allowed-diff.h| 5 -----6 files changed, 5 deletions(-)tests/data/acpi/x86/microvm/DSDT binary +0
-0tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0
-0tests/data/acpi/x86/microvm/DSDT.pcie binary +0
-0tests/data/acpi/x86/microvm/DSDT.rtc binary +0
-0tests/data/acpi/x86/microvm/DSDT.usb binary +0
-0tests/qtest/bios-tables-test-allowed-diff.h +0
-5@@ -1,6 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/microvm/DSDT" , -"tests/data/acpi/x86/microvm/DSDT.ioapic2" , -"tests/data/acpi/x86/microvm/DSDT.pcie" , -"tests/data/acpi/x86/microvm/DSDT.rtc" , -"tests/data/acpi/x86/microvm/DSDT.usb",
RFC PATCH v3 11/13 microvm: suspend the system as requested
In reply to Annie LiOnce the microvm guest requests to go to sleep state and sets the GED register with S3 type, QEMU needs to continue suspending the system.
--- hw/acpi/generic_event_device.c | 3 +++ 1 file changed, 3 insertions(+)
hw/acpi/generic_event_device.c +3 -0
@@ -213,6 +213,9 @@ static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data,if (slp_en && slp_typ ==ACPI_GED_SLP_TYP_S5 ) {qemu_system_shutdown_request (SHUTDOWN_CAUSE_GUEST_SHUTDOWN ); } +if (slp_en && slp_typ ==ACPI_GED_SLP_TYP_S3 ) { +qemu_system_suspend_request (); + }return ;case ACPI_GED_REG_SLEEP_STS :return ;
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 11/13] microvm: suspend the system as requested
Hi Annie,
Quoted 14 lines · Annie Li
Once the microvm guest requests to go to sleep state and sets the GED register with S3 type, QEMU needs to continue suspending the system.
Signed-off-by Annie Li <[email protected]>--- hw/acpi/generic_event_device.c | 3 +++ 1 file changed, 3 insertions(+)hw/acpi/generic_event_device.c +0
-0
hw/acpi/generic_event_device.c static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data, · line 221
Quoted 9 lines
hw/acpi/generic_event_device.c +3
-0@@ -213,6 +213,9 @@ static void ged_regs_write(void *opaque, hwaddr addr, uint64_t data,if (slp_en && slp_typ ==ACPI_GED_SLP_TYP_S5 ) {qemu_system_shutdown_request (SHUTDOWN_CAUSE_GUEST_SHUTDOWN ); } +if (slp_en && slp_typ ==ACPI_GED_SLP_TYP_S3 ) { +qemu_system_suspend_request (); + }return ;case ACPI_GED_REG_SLEEP_STS :return ;
Cheers,
Gustavo
RFC PATCH v3 12/13 microvm: enable suspend
In reply to Annie LiThe 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.
--- hw/i386/microvm.c | 1 + 1 file changed, 1 insertion(+)
hw/i386/microvm.c +1 -0
@@ -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);
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 12/13] microvm: enable suspend
Hi Annie,
Quoted 15 lines · Annie Li
The function
qemu_wakeup_suspend_enabledcombines 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 <[email protected]>--- hw/i386/microvm.c | 1 + 1 file changed, 1 insertion(+)hw/i386/microvm.c +0
-0
hw/i386/microvm.c static void microvm_machine_state_init(MachineState *machine) · line 495
Quoted 7 lines
hw/i386/microvm.c +1
-0@@ -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);
Cheers,
Gustavo
RFC PATCH v3 13/13 acpi: hmp/qmp: Add hmp/qmp support for system_sleep
In reply to Annie LiFollowng hmp/qmp commands are implemented for pressing virtual sleep button,
hmp: system_sleep
qmp: { "execute": "system_sleep" }
These commands put the guest into suspend or other power states depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do so to align to existing 'system_*' commands.
--- hmp-commands.hx | 14 ++++++++++++++ hw/core/machine-hmp-cmds.c | 5 +++++ hw/core/machine-qmp-cmds.c | 11 +++++++++++ include/monitor/hmp.h | 1 + qapi/machine.json | 20 ++++++++++++++++++++ qapi/pragma.json | 1 + 6 files changed, 52 insertions(+)
hmp-commands.hx +14 -0
@@ -639,6 +639,20 @@ SRST whether profiling is on or off. ERST + { + .name = "system_sleep", + .args_type = "", + .params = "", + .help = "send system sleep event", + .cmd = hmp_system_sleep, + }, + +SRST +``system_sleep`` + Push the virtual sleep button; if supported, the system will enter + an ACPI sleep state. +ERST + { .name = "system_reset", .args_type = "",
hw/core/machine-hmp-cmds.c +5 -0
@@ -189,6 +189,11 @@ void hmp_system_reset(Monitor *mon, const QDict *qdict)qmp_system_reset (NULL ); } +void hmp_system_sleep (Monitor *mon,const QDict *qdict) +{ +qmp_system_sleep (NULL ); +} +void hmp_system_powerdown (Monitor *mon,const QDict *qdict) {qmp_system_powerdown (NULL );
hw/core/machine-qmp-cmds.c +11 -0
@@ -12,6 +12,7 @@#include "hw/boards.h" #include "hw/intc/intc.h" #include "hw/mem/memory-device.h" +#include "hw/acpi/acpi.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/qapi-commands-machine.h"
@@ -276,6 +277,16 @@ void qmp_system_reset(Error **errp)qemu_system_reset_request (SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET ); } +void qmp_system_sleep (Error **errp) +{ +if (!qemu_wakeup_suspend_enabled ()) { +error_setg (errp, +"suspend from running is not supported by this machine" ); +return ; + } +acpi_send_sleep_event (); +} +void qmp_system_powerdown (Error **errp) {qemu_system_powerdown_request ();
include/monitor/hmp.h +1 -0
@@ -43,6 +43,7 @@ void hmp_quit(Monitor *mon, const QDict *qdict);void hmp_stop (Monitor *mon,const QDict *qdict);void hmp_sync_profile (Monitor *mon,const QDict *qdict);void hmp_system_reset (Monitor *mon,const QDict *qdict); +void hmp_system_sleep (Monitor *mon,const QDict *qdict);void hmp_system_powerdown (Monitor *mon,const QDict *qdict);void hmp_exit_preconfig (Monitor *mon,const QDict *qdict);void hmp_announce_self (Monitor *mon,const QDict *qdict);
qapi/machine.json +20 -0
@@ -361,6 +361,26 @@ ## { 'command': 'system_reset' } +## +# @system_sleep: +# +# Requests that the guest perform a ACPI sleep transition by pushing +# the virtual sleep button. +# +# Since:10.0 +# +# .. note:: A guest may or may not respond to this command. This +# command returning does not indicate that a guest has +# accepted the request or that it has gone to sleep. +# +# .. qmp-example:: +# +# -> { "execute": "system_sleep" } +# <- { "return": {} } +# +## +{ 'command': 'system_sleep' } + ## # @system_powerdown: #
qapi/pragma.json +1 -0
@@ -23,6 +23,7 @@ 'set_password', 'system_powerdown', 'system_reset', + 'system_sleep', 'system_wakeup' ], # Commands allowed to return a non-dictionary 'command-returns-exceptions': [
Signature · 1 line
2.43.5
Re: [RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
Quoted 13 lines · Annie Li
Followng hmp/qmp commands are implemented for pressing virtual sleep button,
hmp:
system_sleep
qmp: { "execute": "system_sleep" }These commands put the guest into suspend or other power states depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do so to align to existing 'system_*' commands.
Signed-off-by Annie Li <[email protected]>
[...]
Quoted 7 lines
qapi/machine.json +0
-0@@ -361,6 +361,26 @@ ## { 'command': 'system_reset' }
qapi/machine.json line 372
Quoted 10 lines
qapi/machine.json +9
-0+## +# @system_sleep: +# +# Requests that the guest perform a ACPI sleep transition by pushing +# the virtual sleep button. +# +# Since:10.0 +# +# .. note:: A guest may or may not respond to this command. This
Two spaces between sentences for consistency, please.
Quoted 19 lines
qapi/machine.json +11
-0+# command returning does not indicate that a guest has +# accepted the request or that it has gone to sleep. +# +# .. qmp-example:: +# +# -> { "execute": "system_sleep" } +# <- { "return": {} } +# +## +{ 'command': 'system_sleep' } + ## # @system_powerdown: #qapi/pragma.json +0
-0
qapi/pragma.json line 26
Quoted 4 lines
qapi/pragma.json +1
-0@@ -23,6 +23,7 @@ 'set_password', 'system_powerdown', 'system_reset', + 'system_sleep',
Additions here are always sad, but inconsistency with the other system_FOO commands would be worse.
qapi/pragma.json line 29
Quoted 3 lines
qapi/pragma.json +0
-0'system_wakeup' ], # Commands allowed to return a non-dictionary 'command-returns-exceptions': [
With the spacing nit touched up:
Re: [RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
Quoted 25 lines · Markus Armbruster
Quoted 13 lines · Annie Li
Followng hmp/qmp commands are implemented for pressing virtual sleep button,
hmp:
system_sleep
qmp: { "execute": "system_sleep" }These commands put the guest into suspend or other power states depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do so to align to existing 'system_*' commands.
Signed-off-by Annie Li <[email protected]>[...]
Quoted 8 lines
qapi/machine.json +0
-0@@ -361,6 +361,26 @@ ## { 'command': 'system_reset' }
Quoted 10 lines
qapi/machine.json line 372
Quoted 9 lines
qapi/machine.json +9
-0+## +# @system_sleep: +# +# Requests that the guest perform a ACPI sleep transition by pushing +# the virtual sleep button. +# +# Since:10.0 +# +# .. note:: A guest may or may not respond to this command. ThisTwo spaces between sentences for consistency, please.
Didn't notice this, thanks for pointing it out.
Will fix it.
Thanks
Annie
Quoted 33 lines
Quoted 20 lines
qapi/machine.json +11
-0+# command returning does not indicate that a guest has +# accepted the request or that it has gone to sleep. +# +# .. qmp-example:: +# +# -> { "execute": "system_sleep" } +# <- { "return": {} } +# +## +{ 'command': 'system_sleep' } + ## # @system_powerdown: #qapi/pragma.json +0
-0qapi/pragma.json line 26
Quoted 4 lines
qapi/pragma.json +1
-0@@ -23,6 +23,7 @@ 'set_password', 'system_powerdown', 'system_reset', + 'system_sleep',Additions here are always sad, but inconsistency with the other
system_FOOcommands would be worse.qapi/pragma.json line 29
Quoted 3 lines
qapi/pragma.json +0
-0'system_wakeup' ], # Commands allowed to return a non-dictionary 'command-returns-exceptions': [With the spacing nit touched up:
Re: [RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
Hi Annie,
Quoted 6 lines · Annie Li
Quoted 4 lines · Markus Armbruster
Quoted 2 lines · Annie Li
Followng hmp/qmp commands are implemented for pressing virtual sleep button,
nit: Following
Cheers,
Gustavo
Quoted 72 lines
Quoted 21 lines
Quoted 10 lines
hmp:
system_sleep
qmp: { "execute": "system_sleep" }These commands put the guest into suspend or other power states depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do so to align to existing 'system_*' commands.
Signed-off-by Annie Li <[email protected]>[...]
Quoted 9 lines
qapi/machine.json +2
-0@@ -361,6 +361,26 @@ ## { 'command': 'system_reset' } +## +# @system_sleep:Quoted 8 lines
qapi/machine.json line 372
Quoted 7 lines
qapi/machine.json +7
-0+# +# Requests that the guest perform a ACPI sleep transition by pushing +# the virtual sleep button. +# +# Since:10.0 +# +# .. note:: A guest may or may not respond to this command. ThisTwo spaces between sentences for consistency, please.
Didn't notice this, thanks for pointing it out.
Will fix it.
Thanks
Annie
Quoted 33 lines
Quoted 20 lines
qapi/machine.json +11
-0+# command returning does not indicate that a guest has +# accepted the request or that it has gone to sleep. +# +# .. qmp-example:: +# +# -> { "execute": "system_sleep" } +# <- { "return": {} } +# +## +{ 'command': 'system_sleep' } + ## # @system_powerdown: #qapi/pragma.json +0
-0qapi/pragma.json line 26
Quoted 4 lines
qapi/pragma.json +1
-0@@ -23,6 +23,7 @@ 'set_password', 'system_powerdown', 'system_reset', + 'system_sleep',Additions here are always sad, but inconsistency with the other
system_FOOcommands would be worse.Quoted 3 lines
qapi/pragma.json +0
-0'system_wakeup' ], # Commands allowed to return a non-dictionary'command-returns-exceptions': [
With the spacing nit touched up:
Re: [RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
Hi Gustavo,
Quoted 11 lines · Gustavo Romero
Hi Annie,
Quoted 6 lines · Annie Li
Quoted 4 lines · Markus Armbruster
Quoted 2 lines · Annie Li
Followng hmp/qmp commands are implemented for pressing virtual sleep button,
nit: Following
Oops! will fix it.
Thanks for the catch.
Annie
Quoted 78 lines
Cheers,
GustavoQuoted 72 lines
Quoted 21 lines
Quoted 10 lines
hmp:
system_sleep
qmp: { "execute": "system_sleep" }These commands put the guest into suspend or other power states depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do so to align to existing 'system_*' commands.
Signed-off-by Annie Li <[email protected]>[...]
Quoted 9 lines
qapi/machine.json +2
-0@@ -361,6 +361,26 @@ ## { 'command': 'system_reset' } +## +# @system_sleep:Quoted 8 lines
qapi/machine.json line 372
Quoted 7 lines
qapi/machine.json +7
-0+# +# Requests that the guest perform a ACPI sleep transition by pushing +# the virtual sleep button. +# +# Since:10.0 +# +# .. note:: A guest may or may not respond to this command. ThisTwo spaces between sentences for consistency, please.
Didn't notice this, thanks for pointing it out.
Will fix it.
Thanks
Annie
Quoted 33 lines
Quoted 20 lines
qapi/machine.json +11
-0+# command returning does not indicate that a guest has +# accepted the request or that it has gone to sleep. +# +# .. qmp-example:: +# +# -> { "execute": "system_sleep" } +# <- { "return": {} } +# +## +{ 'command': 'system_sleep' } + ## # @system_powerdown: #qapi/pragma.json +0
-0qapi/pragma.json line 26
Quoted 4 lines
qapi/pragma.json +1
-0@@ -23,6 +23,7 @@ 'set_password', 'system_powerdown', 'system_reset', + 'system_sleep',Additions here are always sad, but inconsistency with the other
system_FOOcommands would be worse.Quoted 3 lines
qapi/pragma.json +0
-0'system_wakeup' ], # Commands allowed to return a non-dictionary'command-returns-exceptions': [
With the spacing nit touched up: