Skip to contentSkip to conversation

Support ACPI Control Method Sleep button

RFC PATCH In review Annie Li 5 participants 46 messages Apr 11, 2025 – Apr 17, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Annie Li

author
#0 lore raw

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
author
#1 lore raw

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
new file mode 100644
index 0000000000..c3b1d484c4
@@ -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
index 73f02b9691..a62e625cef 100644
@@ -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
new file mode 100644
index 0000000000..079f1a74dd
@@ -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
#2 lore raw

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.

---
  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
new file mode 100644
index 0000000000..c3b1d484c4
@@ -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
index 73f02b9691..a62e625cef 100644
@@ -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
new file mode 100644
index 0000000000..079f1a74dd
@@ -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
author
#3 lore raw

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.

---
  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
new file mode 100644
index 0000000000..c3b1d484c4
@@ -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 _PRW variable 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,
Gustavo

Quoted 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
index 73f02b9691..a62e625cef 100644
@@ -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
new file mode 100644
index 0000000000..079f1a74dd
@@ -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
author
#4 lore raw

RFC PATCH v3 2/13 test/acpi: allow DSDT table changes for x86 platform

In reply to Annie Li

list 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
index dfb8523c8b..a1047913af 100644
@@ -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
Reviewed-by on v3 2/13
#5 lore raw

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
---
  tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++
  1 file changed, 42 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +32 -0
index dfb8523c8b..a1047913af 100644
@@ -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

author
#6 lore raw

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.h

nit: List

Will fix it.

Thanks

Annie

Quoted 61 lines
Quoted 45 lines

---
  tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++

  1 file changed, 42 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +32 -0
index dfb8523c8b..a1047913af 100644
@@ -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

author
#7 lore raw

RFC PATCH v3 3/13 acpi: Support Control Method sleep button for x86

In reply to 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.

---
 hw/i386/acpi-build.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +21 -1
index 3fffa4a332..4be3595e5a 100644
@@ -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
#8 lore raw

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.

---
  hw/i386/acpi-build.c | 22 +++++++++++++++++++++-
  1 file changed, 21 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +2 -1
index 3fffa4a332..4be3595e5a 100644
@@ -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 {
author
#9 lore raw

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.

---
  hw/i386/acpi-build.c | 22 +++++++++++++++++++++-

  1 file changed, 21 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +2 -1
index 3fffa4a332..4be3595e5a 100644
@@ -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_DEVICE here and in the conditional above it as it's done below for the Notify()?

Make sense.

Thanks

Annie

Quoted 16 lines

Cheers,
Gustavo

Quoted 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 {

author
#10 lore raw

RFC PATCH v3 4/13 tests/qtest/bios-table-tests: Update ACPI table binaries for x86

In reply to Annie Li

Following 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
index 4beb5194b84a711fcb52e3e52cc2096497d18442..62bd8eae9602af4c590c6962689da54e4bff9c70 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
index abda6863b64c5dc8ba5aba1a286cbfa76772a1e4..6c9cf3df3902fb30c704b7a657c4c08402c28837 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
index d081db26d7ba504b3344fad130d5812419291ac0..36f952d730a1d64c1babf7adf05c0ed364f559f3 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
index e16897dc5f0fbb3f7b4de8db913884046246cc3b..da189168ffdae5817a4fe7b0e62531a333cb3d75 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
index e95711cd9cde5d50b841b701ae0fed5a4b15e872..d6f96a071f1a7d570400dffedfd10af38eee0faf 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
index 90ba66b9164f9a958d5a3c4371b1eec03e922828..ee06a74106606a3725b7f6882d020cf487873771 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
index 0eafe5fbf3d73719c9c3e6e26371863bfb44ed2f..1730d2ca1d83c08eca05e35ac1691e559a618489 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
index 077a4cc988dc417a1bc9317dddd2dbd96ff1ff50..4ae9b5586f27761f77eabc801467a343a88d84a4 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
index 8d465f027772f9c59b0c328c1a099e374a6d2a90..71e2566c59b03670df98d8f3dced9b7f7df1a985 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
index e3b49757cb7abd7536ee89a6824967d2cb2485cf..5955bc2920d5327a90ae604d406496d73d543378 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
index 9e772c1316d0ea07c51717466c4c7e383553f345..2eef579e2fb3629b3e6a66eccb1565e2fbf2864d 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
index 9bfbfc28213713c208dfc38a85abb46fb190871d..b2c8220fefd1175ff403a77f77ea2fab7675d096 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
index efbee6d8aa5c62ff4fcb83e6c5cff59542977850..287ec23844e6887a24276d21b9bdcc415796e656 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT binary +0 -0
index e5e8d1e041e20e1b3ee56a5c93fe3d6ebd721ee6..813e489f98b6be8958d8bf9bcf1d0b2eed691a5e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
index 2a4f2fc1d5c5649673353186e67ff5b5e59e8d53..0b911c9425d2f59fc6e0a2aac97fe23ee0b4a18d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
index 7911c058bba5005d318b8db8d6da5c1ee381b0f1..bd0f517847bd71eb78db72010df699c1bea64d4a 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
index 580b4a456a20fc0cc0a832eaf74193b46d8ae8b1..3ab30d885f483c1626a9ab5a3501610923485462 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
index 5e8220e38d6f88b103f6eb3eb7c78dfa466882dc..7e17c9ebb3b7d28526bd04c9af5ca05a3461ac13 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
index ee039453af1071e00a81ee7b37cf8f417f524257..9da24d83ea7ab37c354a0cdbecbcf5129a3e1621 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
index a055c2e7d3c4f5a00a03be20fd73227e322283a4..0b9e315600b8665a8cb4ddfc57c4cf60968d0b4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
index 20843549f54af1cb0e6017c4cfff7463318d9eb7..0a49b62f39f1e4e00db2d03bbf34de4e20f2ed7d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
index 664e926e90765550136242f7e3e0bdc7719c1853..1c14b91bb4d341d16527d330e2bb0515e2fafb81 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
index 4066a76d26aa380dfbecc58aa3f83ab5db2baadb..5561088d97a871f858461680d77d016f6b71d799 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
index 6d0b6b95c2a9fd01befc37b26650781ee1562e2a..cecba8c0629f89d2ccdd017791be69e5a98f52fa 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
index 4f2f9bcfceff076490cc49b8286380295a340004..056366a2c9fd535fa02d7494181e76b6a76b4cfb 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
index 0fb6aab16f1bd79f3c0790cc9f644f7e52ac37b1..3ab05c9ec6afa014ad53ad246fcba7336bef3901 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
index f6afa6d96d2525d512cc46f17439f7a49962b730..41543787c443606ccef7191c2b0bee6737efe752 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
index 9f7261d1b06bbf5d8a3e5a7a46b247a2a21eb544..1c09aff8b5b8955730d5ca1737e4e7f6e698e401 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
index 99ad629c9171ff6ab346d6b4c519e77ca23e5b1c..86a109d6b12d38501d4353b5f8e31e9f3c15dd43 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
index fd1d8a79d3d9b071c8796e5e99b76698a9a8d29c..454aa65803d8da71c9d5f1a263fa0b59bb76af4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
index 89032fa0290f496be0c06c6382586541aa1118a8..8ef053f6dc2f1c3086756698c5953e857067df9d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
index f2ed40ca70cb13e733e39f4bad756be8688e01fe..a36710dd89085f8ec5f173b84d4cd2a25473530e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
index 5c975d2162d0bfee5a3a089e79b5ba038f82b7ef..c7d737509dfd229d2dde46ea92d292039d854f79 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
index 3194a82b8b4f66aff1ecf7d2d60b4890181fc600..2d8b82a36ef1a8a4325817b164f77ceda78dd42e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
index 129d43e1e561be3fd7cd71406829ab81d0a8aba0..3920d98b2501b08a4e0d57767a8c47cd57080748 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
index b37ab591110d1c8201575ad6bba83449d7b90b21..1c6c420f9edb16f2e706d2b495d6e856441de000 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -42

43 lines not on this page · raw message

Signature · 1 line
2.43.5
Reviewed-by on v3 4/13
#11 lore raw

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.c

Diff 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)
---
  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
index 4beb5194b84a711fcb52e3e52cc2096497d18442..62bd8eae9602af4c590c6962689da54e4bff9c70 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
index abda6863b64c5dc8ba5aba1a286cbfa76772a1e4..6c9cf3df3902fb30c704b7a657c4c08402c28837 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
index d081db26d7ba504b3344fad130d5812419291ac0..36f952d730a1d64c1babf7adf05c0ed364f559f3 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
index e16897dc5f0fbb3f7b4de8db913884046246cc3b..da189168ffdae5817a4fe7b0e62531a333cb3d75 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
index e95711cd9cde5d50b841b701ae0fed5a4b15e872..d6f96a071f1a7d570400dffedfd10af38eee0faf 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
index 90ba66b9164f9a958d5a3c4371b1eec03e922828..ee06a74106606a3725b7f6882d020cf487873771 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
index 0eafe5fbf3d73719c9c3e6e26371863bfb44ed2f..1730d2ca1d83c08eca05e35ac1691e559a618489 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
index 077a4cc988dc417a1bc9317dddd2dbd96ff1ff50..4ae9b5586f27761f77eabc801467a343a88d84a4 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
index 8d465f027772f9c59b0c328c1a099e374a6d2a90..71e2566c59b03670df98d8f3dced9b7f7df1a985 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
index e3b49757cb7abd7536ee89a6824967d2cb2485cf..5955bc2920d5327a90ae604d406496d73d543378 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
index 9e772c1316d0ea07c51717466c4c7e383553f345..2eef579e2fb3629b3e6a66eccb1565e2fbf2864d 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
index 9bfbfc28213713c208dfc38a85abb46fb190871d..b2c8220fefd1175ff403a77f77ea2fab7675d096 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
index efbee6d8aa5c62ff4fcb83e6c5cff59542977850..287ec23844e6887a24276d21b9bdcc415796e656 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT binary +0 -0
index e5e8d1e041e20e1b3ee56a5c93fe3d6ebd721ee6..813e489f98b6be8958d8bf9bcf1d0b2eed691a5e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
index 2a4f2fc1d5c5649673353186e67ff5b5e59e8d53..0b911c9425d2f59fc6e0a2aac97fe23ee0b4a18d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
index 7911c058bba5005d318b8db8d6da5c1ee381b0f1..bd0f517847bd71eb78db72010df699c1bea64d4a 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
index 580b4a456a20fc0cc0a832eaf74193b46d8ae8b1..3ab30d885f483c1626a9ab5a3501610923485462 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
index 5e8220e38d6f88b103f6eb3eb7c78dfa466882dc..7e17c9ebb3b7d28526bd04c9af5ca05a3461ac13 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
index ee039453af1071e00a81ee7b37cf8f417f524257..9da24d83ea7ab37c354a0cdbecbcf5129a3e1621 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
index a055c2e7d3c4f5a00a03be20fd73227e322283a4..0b9e315600b8665a8cb4ddfc57c4cf60968d0b4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
index 20843549f54af1cb0e6017c4cfff7463318d9eb7..0a49b62f39f1e4e00db2d03bbf34de4e20f2ed7d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
index 664e926e90765550136242f7e3e0bdc7719c1853..1c14b91bb4d341d16527d330e2bb0515e2fafb81 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
index 4066a76d26aa380dfbecc58aa3f83ab5db2baadb..5561088d97a871f858461680d77d016f6b71d799 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
index 6d0b6b95c2a9fd01befc37b26650781ee1562e2a..cecba8c0629f89d2ccdd017791be69e5a98f52fa 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
index 4f2f9bcfceff076490cc49b8286380295a340004..056366a2c9fd535fa02d7494181e76b6a76b4cfb 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
index 0fb6aab16f1bd79f3c0790cc9f644f7e52ac37b1..3ab05c9ec6afa014ad53ad246fcba7336bef3901 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
index f6afa6d96d2525d512cc46f17439f7a49962b730..41543787c443606ccef7191c2b0bee6737efe752 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
index 9f7261d1b06bbf5d8a3e5a7a46b247a2a21eb544..1c09aff8b5b8955730d5ca1737e4e7f6e698e401 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
index 99ad629c9171ff6ab346d6b4c519e77ca23e5b1c..86a109d6b12d38501d4353b5f8e31e9f3c15dd43 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
index fd1d8a79d3d9b071c8796e5e99b76698a9a8d29c..454aa65803d8da71c9d5f1a263fa0b59bb76af4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
index 89032fa0290f496be0c06c6382586541aa1118a8..8ef053f6dc2f1c3086756698c5953e857067df9d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
index f2ed40ca70cb13e733e39f4bad756be8688e01fe..a36710dd89085f8ec5f173b84d4cd2a25473530e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
index 5c975d2162d0bfee5a3a089e79b5ba038f82b7ef..c7d737509dfd229d2dde46ea92d292039d854f79 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
index 3194a82b8b4f66aff1ecf7d2d60b4890181fc600..2d8b82a36ef1a8a4325817b164f77ceda78dd42e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
index 129d43e1e561be3fd7cd71406829ab81d0a8aba0..3920d98b2501b08a4e0d57767a8c47cd57080748 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
index b37ab591110d1c8201575ad6bba83449d7b90b21..1c6c420f9edb16f2e706d2b495d6e856441de000 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -42
index a1047913af..dfb8523c8b 100644
@@ -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",
author
#12 lore raw

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.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 +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:34 
Quoted 2 lines

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 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-EMBW42 brings no information to the commit message.

Sure, will fix comments as suggestions above.

Thanks

Annie

Quoted 653 lines

Otherwise:

Cheers,
Gustavo

Quoted 642 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 +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)

---
  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
index 4beb5194b84a711fcb52e3e52cc2096497d18442..62bd8eae9602af4c590c6962689da54e4bff9c70 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
index abda6863b64c5dc8ba5aba1a286cbfa76772a1e4..6c9cf3df3902fb30c704b7a657c4c08402c28837 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
index d081db26d7ba504b3344fad130d5812419291ac0..36f952d730a1d64c1babf7adf05c0ed364f559f3 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
index e16897dc5f0fbb3f7b4de8db913884046246cc3b..da189168ffdae5817a4fe7b0e62531a333cb3d75 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
index e95711cd9cde5d50b841b701ae0fed5a4b15e872..d6f96a071f1a7d570400dffedfd10af38eee0faf 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
index 90ba66b9164f9a958d5a3c4371b1eec03e922828..ee06a74106606a3725b7f6882d020cf487873771 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
index 0eafe5fbf3d73719c9c3e6e26371863bfb44ed2f..1730d2ca1d83c08eca05e35ac1691e559a618489 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
index 077a4cc988dc417a1bc9317dddd2dbd96ff1ff50..4ae9b5586f27761f77eabc801467a343a88d84a4 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
index 8d465f027772f9c59b0c328c1a099e374a6d2a90..71e2566c59b03670df98d8f3dced9b7f7df1a985 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
index e3b49757cb7abd7536ee89a6824967d2cb2485cf..5955bc2920d5327a90ae604d406496d73d543378 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
index 9e772c1316d0ea07c51717466c4c7e383553f345..2eef579e2fb3629b3e6a66eccb1565e2fbf2864d 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
index 9bfbfc28213713c208dfc38a85abb46fb190871d..b2c8220fefd1175ff403a77f77ea2fab7675d096 100644
GIT binary patch
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
index efbee6d8aa5c62ff4fcb83e6c5cff59542977850..287ec23844e6887a24276d21b9bdcc415796e656 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT binary +0 -0
index e5e8d1e041e20e1b3ee56a5c93fe3d6ebd721ee6..813e489f98b6be8958d8bf9bcf1d0b2eed691a5e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
index 2a4f2fc1d5c5649673353186e67ff5b5e59e8d53..0b911c9425d2f59fc6e0a2aac97fe23ee0b4a18d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
index 7911c058bba5005d318b8db8d6da5c1ee381b0f1..bd0f517847bd71eb78db72010df699c1bea64d4a 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
index 580b4a456a20fc0cc0a832eaf74193b46d8ae8b1..3ab30d885f483c1626a9ab5a3501610923485462 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
index 5e8220e38d6f88b103f6eb3eb7c78dfa466882dc..7e17c9ebb3b7d28526bd04c9af5ca05a3461ac13 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
index ee039453af1071e00a81ee7b37cf8f417f524257..9da24d83ea7ab37c354a0cdbecbcf5129a3e1621 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
index a055c2e7d3c4f5a00a03be20fd73227e322283a4..0b9e315600b8665a8cb4ddfc57c4cf60968d0b4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
index 20843549f54af1cb0e6017c4cfff7463318d9eb7..0a49b62f39f1e4e00db2d03bbf34de4e20f2ed7d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
index 664e926e90765550136242f7e3e0bdc7719c1853..1c14b91bb4d341d16527d330e2bb0515e2fafb81 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
index 4066a76d26aa380dfbecc58aa3f83ab5db2baadb..5561088d97a871f858461680d77d016f6b71d799 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
index 6d0b6b95c2a9fd01befc37b26650781ee1562e2a..cecba8c0629f89d2ccdd017791be69e5a98f52fa 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
index 072a3fe2cd17dfe06658dfd82588f69787810114..2d81bcbc781d3fc68a053d5319fbdcfa153a4653 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
index 4f2f9bcfceff076490cc49b8286380295a340004..056366a2c9fd535fa02d7494181e76b6a76b4cfb 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
index 0fb6aab16f1bd79f3c0790cc9f644f7e52ac37b1..3ab05c9ec6afa014ad53ad246fcba7336bef3901 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
index f6afa6d96d2525d512cc46f17439f7a49962b730..41543787c443606ccef7191c2b0bee6737efe752 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
index 9f7261d1b06bbf5d8a3e5a7a46b247a2a21eb544..1c09aff8b5b8955730d5ca1737e4e7f6e698e401 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
index 99ad629c9171ff6ab346d6b4c519e77ca23e5b1c..86a109d6b12d38501d4353b5f8e31e9f3c15dd43 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
index fd1d8a79d3d9b071c8796e5e99b76698a9a8d29c..454aa65803d8da71c9d5f1a263fa0b59bb76af4f 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
index 89032fa0290f496be0c06c6382586541aa1118a8..8ef053f6dc2f1c3086756698c5953e857067df9d 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
index 7ebfceeb66460d0ad98471924ce224b7153e87ef..22bf4a17db1b8175db939c5159e1686c8bc54066 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
index d0394558a1faa0b4ba43abab66d474d96b477ff3..69e710caba4a353d3c0805acc8faba7043bf0ff3 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
index f2ed40ca70cb13e733e39f4bad756be8688e01fe..a36710dd89085f8ec5f173b84d4cd2a25473530e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
index 5c975d2162d0bfee5a3a089e79b5ba038f82b7ef..c7d737509dfd229d2dde46ea92d292039d854f79 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
index 3194a82b8b4f66aff1ecf7d2d60b4890181fc600..2d8b82a36ef1a8a4325817b164f77ceda78dd42e 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
index 129d43e1e561be3fd7cd71406829ab81d0a8aba0..3920d98b2501b08a4e0d57767a8c47cd57080748 100644
GIT binary patch
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
index b37ab591110d1c8201575ad6bba83449d7b90b21..1c6c420f9edb16f2e706d2b495d6e856441de000 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -42
index a1047913af..dfb8523c8b 100644
@@ -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",
author
#13 lore raw

RFC PATCH v3 5/13 acpi: Send the GPE event of suspend and wakeup for x86

In reply to Annie Li

The 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
index 58f8964e13..00a9d226f0 100644
@@ -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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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
#14 lore raw

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_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 +0 -0
index 58f8964e13..00a9d226f0 100644

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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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
author
#15 lore raw

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_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 +0 -0
index 58f8964e13..00a9d226f0 100644
@@ -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_IF interface 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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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"
#16 lore raw

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_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(+)
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
index 58f8964e13..00a9d226f0 100644
@@ -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 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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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"
author
#17 lore raw

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_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(+)
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
index 58f8964e13..00a9d226f0 100644
@@ -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 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_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.

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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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"
#18 lore raw

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_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(+)
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
index 58f8964e13..00a9d226f0 100644
@@ -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 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_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.

Quoted 9 lines

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.

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
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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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"
#19 lore raw

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_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(+)
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
index 58f8964e13..00a9d226f0 100644
@@ -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 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_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.

Quoted 9 lines

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.

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

author
#20 lore raw

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_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(+)
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
index 58f8964e13..00a9d226f0 100644
@@ -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 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_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.

Quoted 9 lines

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.

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_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.

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

#21 lore raw

Re: [RFC V3 PATCH 05/13] acpi: Send the GPE event of suspend and wakeup for x86

In reply to Annie Li

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.

Quoted 3 lines

itself. The function acpi_send_sleep_event will 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
---
  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
index 58f8964e13..00a9d226f0 100644
@@ -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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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
index 68d9d15f50..1cb050cd3a 100644
@@ -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"
author
#22 lore raw

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_event will 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,
Gustavo

Quoted 49 lines

---
  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
index 58f8964e13..00a9d226f0 100644
@@ -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
index d1a4fa2af8..64d3ff78ed 100644
@@ -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.h b/include/hw/acpi/acpi_dev_interface.h index 68d9d15f50..1cb050cd3a 100644

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"
author
#23 lore raw

RFC PATCH v3 6/13 test/acpi: allow DSDT table changes for microvm

In reply to Annie Li

list 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
index dfb8523c8b..bb028db137 100644
@@ -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
Reviewed-by on v3 6/13
#24 lore raw

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
---
  tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++
  1 file changed, 5 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +0 -0
index dfb8523c8b..bb028db137 100644

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

author
#25 lore raw

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.h

nit: List

Good catch, will fix it.

Annie

Quoted 24 lines
Quoted 12 lines

---
  tests/qtest/bios-tables-test-allowed-diff.h | 5 +++++

  1 file changed, 5 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +0 -0
index dfb8523c8b..bb028db137 100644

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

author
#26 lore raw

RFC PATCH v3 7/13 microvm: support control method sleep button

In reply to Annie Li

Add 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
index 279da6b4aa..57c45ea327 100644
@@ -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
index d2dac87b4a..28c5785863 100644
@@ -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
#27 lore raw

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
---
  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
index 279da6b4aa..57c45ea327 100644
@@ -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
index d2dac87b4a..28c5785863 100644
@@ -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"
author
#28 lore raw

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

---
  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
index 279da6b4aa..57c45ea327 100644
@@ -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,
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
index d2dac87b4a..28c5785863 100644
@@ -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"

author
#29 lore raw

RFC PATCH v3 8/13 hw/acpi: Add ACPI GED support for the sleep event

In reply to 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.

---
 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
index c85d97ca37..5a1ac8e362 100644
@@ -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
index 28c5785863..71503e0100 100644
@@ -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
Reviewed-by on v3 8/13
#30 lore raw

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.

---
  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
index c85d97ca37..5a1ac8e362 100644
@@ -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
index 28c5785863..71503e0100 100644

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

author
#31 lore raw

RFC PATCH v3 9/13 microvm: enable sleep GED event

In reply to Annie Li

The 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
index d0a236c74f..eba33c4365 100644
@@ -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
Reviewed-by on v3 9/13
#32 lore raw

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
---
  hw/i386/microvm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/microvm.c +0 -0
index d0a236c74f..eba33c4365 100644

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

author
#33 lore raw

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

---
  hw/i386/microvm.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/microvm.c +2 -1
index d0a236c74f..eba33c4365 100644
@@ -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); */

Cheers,
Gustavo

author
#34 lore raw

RFC PATCH v3 10/13 tests/qtest/bios-table-tests: Update ACPI table binaries for microvm

In reply to Annie Li

Following 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
index f477668f2ee80241e47b340ad4a30f5480df2049..ee199a4fb65ab1a2d811f37d9b5bc67bccd34939 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0 -0
index e5924a49962e0cff4228bcfc77ebcf48cb4a2219..7512d1527cf222d6f75a92f051f9eda402e28376 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.pcie binary +0 -0
index 8eacd21d6ecdf9a3cd3e4f03cf1b40748dcbf53e..5e3f80cbf82cab52fe310160c88d0a11ff069bf5 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.rtc binary +0 -0
index e375473b5f033d374dd2a64a9f814fd16c3e262f..11258908703b64a835bd14307490c62c5ef7301f 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.usb binary +0 -0
index d63fd84620a2689120b32262f964e6a098d71632..7250d9f8ad45fca91afeda1089090eee11cd6594 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
index bb028db137..dfb8523c8b 100644
@@ -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
Reviewed-by on v3 10/13
#35 lore raw

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.c

Diff 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
          })
      }
  }
 
---
  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
index f477668f2ee80241e47b340ad4a30f5480df2049..ee199a4fb65ab1a2d811f37d9b5bc67bccd34939 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0 -0
index e5924a49962e0cff4228bcfc77ebcf48cb4a2219..7512d1527cf222d6f75a92f051f9eda402e28376 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.pcie binary +0 -0
index 8eacd21d6ecdf9a3cd3e4f03cf1b40748dcbf53e..5e3f80cbf82cab52fe310160c88d0a11ff069bf5 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.rtc binary +0 -0
index e375473b5f033d374dd2a64a9f814fd16c3e262f..11258908703b64a835bd14307490c62c5ef7301f 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.usb binary +0 -0
index d63fd84620a2689120b32262f964e6a098d71632..7250d9f8ad45fca91afeda1089090eee11cd6594 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
index bb028db137..dfb8523c8b 100644
@@ -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",
author
#36 lore raw

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.c

Diff 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 11 
Quoted 2 lines

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.

Nod, will fix it.

Thanks

Annie

Quoted 199 lines

Otherwise:

Cheers,
Gustavo

Quoted 189 lines

   *
   * 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 {

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
          })
      }
  }

---
  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
index f477668f2ee80241e47b340ad4a30f5480df2049..ee199a4fb65ab1a2d811f37d9b5bc67bccd34939 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.ioapic2 binary +0 -0
index e5924a49962e0cff4228bcfc77ebcf48cb4a2219..7512d1527cf222d6f75a92f051f9eda402e28376 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.pcie binary +0 -0
index 8eacd21d6ecdf9a3cd3e4f03cf1b40748dcbf53e..5e3f80cbf82cab52fe310160c88d0a11ff069bf5 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.rtc binary +0 -0
index e375473b5f033d374dd2a64a9f814fd16c3e262f..11258908703b64a835bd14307490c62c5ef7301f 100644
GIT binary patch
tests/data/acpi/x86/microvm/DSDT.usb binary +0 -0
index d63fd84620a2689120b32262f964e6a098d71632..7250d9f8ad45fca91afeda1089090eee11cd6594 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -5
index bb028db137..dfb8523c8b 100644
@@ -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",
author
#37 lore raw

RFC PATCH v3 11/13 microvm: suspend the system as requested

In reply to 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.

---
 hw/acpi/generic_event_device.c | 3 +++
 1 file changed, 3 insertions(+)
hw/acpi/generic_event_device.c +3 -0
index 5a1ac8e362..bc53551a45 100644
@@ -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
Reviewed-by on v3 11/13
#38 lore raw

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.

---
  hw/acpi/generic_event_device.c | 3 +++
  1 file changed, 3 insertions(+)
hw/acpi/generic_event_device.c +0 -0
index 5a1ac8e362..bc53551a45 100644

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

author
#39 lore raw

RFC PATCH v3 12/13 microvm: enable suspend

In reply to Annie Li

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

---
 hw/i386/microvm.c | 1 +
 1 file changed, 1 insertion(+)
hw/i386/microvm.c +1 -0
index eba33c4365..da5d4126e5 100644
@@ -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
Reviewed-by on v3 12/13
#40 lore raw

Re: [RFC V3 PATCH 12/13] microvm: enable suspend

Hi Annie,

Quoted 15 lines · Annie Li

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

---
  hw/i386/microvm.c | 1 +
  1 file changed, 1 insertion(+)
hw/i386/microvm.c +0 -0
index eba33c4365..da5d4126e5 100644

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

author
#41 lore raw

RFC PATCH v3 13/13 acpi: hmp/qmp: Add hmp/qmp support for system_sleep

In reply to 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.

---
 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
index 06746f0afc..12f08f3444 100644
@@ -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
index c6325cdcaa..f8a7c1de88 100644
@@ -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
index 3130c5cd45..823a8751b2 100644
@@ -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
index ae116d9804..e543eec109 100644
@@ -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
index a6b8795b09..0965e78f4e 100644
@@ -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
index 023a2ef7bc..285ce82e9b 100644
@@ -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
Acked-by on v3 13/13
#42 lore raw

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.

[...]

Quoted 7 lines
qapi/machine.json +0 -0
index a6b8795b09..0965e78f4e 100644
@@ -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
index 023a2ef7bc..285ce82e9b 100644

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:

author
#43 lore raw

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.

[...]

Quoted 8 lines
qapi/machine.json +0 -0
index a6b8795b09..0965e78f4e 100644
@@ -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. This

Two 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 -0
index 023a2ef7bc..285ce82e9b 100644

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:

#44 lore raw

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.

[...]

Quoted 9 lines
qapi/machine.json +2 -0
index a6b8795b09..0965e78f4e 100644
@@ -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. This

Two 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 -0
index 023a2ef7bc..285ce82e9b 100644

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.

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:

author
#45 lore raw

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,
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.

[...]

Quoted 9 lines
qapi/machine.json +2 -0
index a6b8795b09..0965e78f4e 100644
@@ -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. This

Two 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 -0
index 023a2ef7bc..285ce82e9b 100644

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.

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: