* [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button
@ 2024-09-27 18:38 Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
` (11 more replies)
0 siblings, 12 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:38 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
The ACPI sleep button can be implemented as a fixed hardware button
or Control Method Sleep button.
The patch of implementing a fixed hardware sleep button was posted
here 1). More discussions can be found here 2). Essentially, the
discussion mainly focuses on whether the sleep button is implemented
as a fixed hardware button or Control Method Sleep button. The latter
benefits various architectures since the code can be shared among
them.
This patch set implements Control Method Sleep button for both x86
and ARM platform.(The patch set was posted previously here 3). We
rebase all the patches on QEMU9.1.0 and re-post it).
For x86, a sleep button GPE event handler is implemented, so a GPE
event is triggered to indicate the OSPM the sleep button is pressed.
Tests have been done for Linux guest, and Windows Server guest,
the sleep button works as expected.
For ARM, a GED event is triggered to notify the OSPM. With proper
debug knobs it is possible to see the guest OSPM acknowledges the
sleep event:
(qemu) system_sleep
(qemu) [6.744138] exregion-0179 ex_system_memory_space: System-Memory (width 32) R/W 0 Address=0000000009080000
[6.746003] evmisc-0132 ev_queue_notify_reques: Dispatching Notify on [SLPB] (Device) Value 0x80 (Status Change) Node 00000000f0e6819e
[6.802873] PM: suspend entry (s2idle)
[6.806201] Filesystems sync: 0.002 seconds
[6.807580] Freezing user space processes
[6.809478] Freezing user space processes completed (elapsed 0.001 seconds)
[6.810602] OOM killer disabled.
[6.811111] Freezing remaining freezable tasks
[6.812953] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[6.814126] printk: Suspending console(s) (use no_console_suspend to debug)
But that seems to be all, depicting that sleep/wakeup for ARM is broken
and there are still missing some pieces of the puzzle.
Nonetheless, we would like to take this RFC as an opportunity for updates
on this subject as possible roadmaps.
1) https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06478.html
2) https://lore.kernel.org/all/20210920095316.2dd133be@redhat.com/T/#mfe24f89778020deeacfe45083f3eea3cf9f55961
3) https://lore.kernel.org/all/20231205002143.562-1-annie.li@oracle.com/T/
Annie Li (6):
acpi: hmp/qmp: Add hmp/qmp support for system_sleep
acpi: Implement control method sleep button
test/acpi: allow DSDT table changes
acpi: Support Control Method sleep button for x86
tests/acpi: Update DSDT tables for Control method sleep button
acpi: Send the GPE event of suspend and wakeup for x86
Miguel Luis (5):
hw/acpi: Add ACPI GED support for the sleep event
tests/acpi: allow FACP and DSDT table changes for arm/virt
hw/arm: enable sleep support for arm/virt
tests/acpi: Update FACP and DSDT tables for sleep button
arm/virt: enable sleep support
hmp-commands.hx | 14 +++++
hw/acpi/control_method_device.c | 54 ++++++++++++++++++
hw/acpi/core.c | 17 ++++--
hw/acpi/generic_event_device.c | 9 +++
hw/acpi/meson.build | 1 +
hw/arm/virt-acpi-build.c | 13 +++++
hw/arm/virt.c | 14 ++++-
hw/core/machine-hmp-cmds.c | 5 ++
hw/core/machine-qmp-cmds.c | 11 ++++
hw/i386/acpi-build.c | 9 +++
include/hw/acpi/acpi.h | 1 +
include/hw/acpi/acpi_dev_interface.h | 1 +
include/hw/acpi/control_method_device.h | 25 ++++++++
include/hw/acpi/generic_event_device.h | 1 +
include/hw/arm/virt.h | 1 +
include/monitor/hmp.h | 1 +
qapi/machine.json | 18 ++++++
qapi/pragma.json | 1 +
tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5278 bytes
.../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5364 bytes
tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6639 bytes
tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7761 bytes
tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5480 bytes
tests/data/acpi/aarch64/virt/FACP | Bin 276 -> 276 bytes
tests/data/acpi/x86/pc/DSDT | Bin 6830 -> 7012 bytes
tests/data/acpi/x86/pc/DSDT.acpierst | Bin 6741 -> 6923 bytes
tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 8155 -> 8337 bytes
tests/data/acpi/x86/pc/DSDT.bridge | Bin 13701 -> 13883 bytes
tests/data/acpi/x86/pc/DSDT.cphp | Bin 7294 -> 7476 bytes
tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 8484 -> 8666 bytes
tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 6781 -> 6963 bytes
tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 3337 -> 3519 bytes
tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 6902 -> 7084 bytes
tests/data/acpi/x86/pc/DSDT.memhp | Bin 8189 -> 8371 bytes
tests/data/acpi/x86/pc/DSDT.nohpet | Bin 6688 -> 6870 bytes
tests/data/acpi/x86/pc/DSDT.numamem | Bin 6836 -> 7018 bytes
tests/data/acpi/x86/pc/DSDT.roothp | Bin 10623 -> 10805 bytes
tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8537 bytes
tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8554 bytes
tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9862 bytes
.../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8816 bytes
tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8583 bytes
tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12150 bytes
tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 13095 bytes
tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33952 bytes
tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 9001 bytes
tests/data/acpi/x86/q35/DSDT.cxl | Bin 9714 -> 9896 bytes
tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10191 bytes
tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8612 bytes
tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8625 bytes
tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8554 bytes
tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9896 bytes
tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9667 bytes
tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13390 bytes
tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8417 bytes
tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8395 bytes
tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8543 bytes
tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8638 bytes
tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 13095 bytes
tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33952 bytes
tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9143 bytes
tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9169 bytes
tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18771 bytes
tests/data/acpi/x86/q35/DSDT.viot | Bin 9464 -> 9646 bytes
tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35900 bytes
65 files changed, 191 insertions(+), 5 deletions(-)
create mode 100644 hw/acpi/control_method_device.c
create mode 100644 include/hw/acpi/control_method_device.h
--
2.43.5
^ permalink raw reply [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
@ 2024-09-27 18:38 ` Annie Li
2024-10-07 12:44 ` Igor Mammedov
2024-09-27 18:38 ` [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Annie Li
` (10 subsequent siblings)
11 siblings, 1 reply; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:38 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
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.
Signed-off-by: Annie Li <annie.li@oracle.com>
---
hmp-commands.hx | 14 ++++++++++++++
hw/core/machine-hmp-cmds.c | 5 +++++
hw/core/machine-qmp-cmds.c | 9 +++++++++
include/monitor/hmp.h | 1 +
qapi/machine.json | 18 ++++++++++++++++++
qapi/pragma.json | 1 +
6 files changed, 48 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 06746f0afc..4c149f403f 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -639,6 +639,20 @@ SRST
whether profiling is on or off.
ERST
+ {
+ .name = "system_sleep",
+ .args_type = "",
+ .params = "",
+ .help = "send ACPI 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 = "",
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 8701f00cc7..3ee529d8d5 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -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);
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 130217da8f..770f8189ba 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -276,6 +276,15 @@ 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 guest");
+ return;
+ }
+}
+
void qmp_system_powerdown(Error **errp)
{
qemu_system_powerdown_request();
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index ae116d9804..e543eec109 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -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);
diff --git a/qapi/machine.json b/qapi/machine.json
index d4317435e7..b32d231aa9 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -362,6 +362,24 @@
##
{ 'command': 'system_reset' }
+##
+# @system_sleep:
+#
+# Requests that a guest perform a ACPI sleep transition by pushing a virtual
+# sleep button.
+#
+# .. 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:
#
diff --git a/qapi/pragma.json b/qapi/pragma.json
index 59fbe74b8c..e2c5dcb829 100644
--- a/qapi/pragma.json
+++ b/qapi/pragma.json
@@ -23,6 +23,7 @@
'set_password',
'system_powerdown',
'system_reset',
+ 'system_sleep',
'system_wakeup' ],
# Commands allowed to return a non-dictionary
'command-returns-exceptions': [
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 02/11] acpi: Implement control method sleep button
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
@ 2024-09-27 18:38 ` Annie Li
2024-10-07 12:59 ` Igor Mammedov
2024-09-27 18:38 ` [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes Annie Li
` (9 subsequent siblings)
11 siblings, 1 reply; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:38 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
The control method sleep button is added, as well as its GPE event
handler.
Co-developed-by: Miguel Luis <miguel.luis@oracle.com>
Signed-off-by: Annie Li <annie.li@oracle.com>
---
hw/acpi/control_method_device.c | 54 +++++++++++++++++++++++++
hw/acpi/meson.build | 1 +
include/hw/acpi/control_method_device.h | 25 ++++++++++++
3 files changed, 80 insertions(+)
diff --git a/hw/acpi/control_method_device.c b/hw/acpi/control_method_device.c
new file mode 100644
index 0000000000..f52c190352
--- /dev/null
+++ b/hw/acpi/control_method_device.c
@@ -0,0 +1,54 @@
+/*
+ * Control method devices
+ *
+ * Copyright (c) 2023 Oracle and/or its affiliates.
+ *
+ *
+ * Authors:
+ * Annie Li <annie.li@oracle.com>
+ *
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "hw/acpi/control_method_device.h"
+#include "hw/mem/nvdimm.h"
+
+void acpi_dsdt_add_sleep_button(Aml *scope)
+{
+ Aml *dev = aml_device("\\_SB."ACPI_SLEEP_BUTTON_DEVICE);
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0E")));
+ Aml *pkg = aml_package(2);
+ aml_append(pkg, aml_int(0x01));
+ aml_append(pkg, aml_int(0x04));
+ aml_append(dev, aml_name_decl("_PRW", pkg));
+ aml_append(dev, aml_operation_region("\\Boo", AML_SYSTEM_IO,
+ aml_int(0x201), 0x1));
+ Aml *field = aml_field("\\Boo", AML_BYTE_ACC, AML_NOLOCK,
+ AML_WRITE_AS_ZEROS);
+ aml_append(field, aml_named_field("SBP", 1));
+ aml_append(field, aml_named_field("SBW", 1));
+ aml_append(dev, field);
+ aml_append(scope, dev);
+}
+
+void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope)
+{
+ Aml *method = aml_method("_L07", 0, AML_NOTSERIALIZED);
+ Aml *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);
+ condition = aml_if(aml_name("\\_SB.SLPB.SBW"));
+ aml_append(condition, aml_store(aml_int(1), aml_name("\\_SB.SLPB.SBW")));
+ aml_append(condition,
+ aml_notify(aml_name("\\_SB."ACPI_SLEEP_BUTTON_DEVICE),
+ aml_int(0x2)));
+ aml_append(method, condition);
+ aml_append(scope, method);
+}
diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
index fa5c07db90..0b4f1b432d 100644
--- a/hw/acpi/meson.build
+++ b/hw/acpi/meson.build
@@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c'))
acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.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'))
diff --git a/include/hw/acpi/control_method_device.h b/include/hw/acpi/control_method_device.h
new file mode 100644
index 0000000000..87f8d6fd59
--- /dev/null
+++ b/include/hw/acpi/control_method_device.h
@@ -0,0 +1,25 @@
+/*
+ * Control method devices
+ *
+ * Copyright (c) 2023 Oracle and/or its affiliates.
+ *
+ *
+ * Authors:
+ * Annie Li <annie.li@oracle.com>
+ *
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+
+#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);
+void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope);
+
+#endif
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Annie Li
@ 2024-09-27 18:38 ` Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Annie Li
` (8 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:38 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
Signed-off-by: Annie Li <annie.li@oracle.com>
---
tests/qtest/bios-tables-test-allowed-diff.h | 41 +++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..512d40665d 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,42 @@
/* 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-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",
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (2 preceding siblings ...)
2024-09-27 18:38 ` [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes Annie Li
@ 2024-09-27 18:38 ` Annie Li
2024-10-07 13:32 ` Igor Mammedov
2024-09-27 18:39 ` [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button Annie Li
` (7 subsequent siblings)
11 siblings, 1 reply; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:38 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
Adding Control Method Sleep button and its GPE event handler for
x86.
Signed-off-by: Annie Li <annie.li@oracle.com>
---
hw/i386/acpi-build.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5d4bd2b710..ee62333a03 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -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 "sysemu/tpm.h"
#include "hw/acpi/tpm.h"
#include "hw/acpi/vmgenid.h"
@@ -1527,6 +1528,14 @@ 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);
+
+ scope = aml_scope("\\_GPE");
+ acpi_dsdt_add_sleep_gpe_event_handler(scope);
+ aml_append(dsdt, scope);
+
if (pcmc->legacy_cpu_hotplug) {
build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
} else {
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (3 preceding siblings ...)
2024-09-27 18:38 ` [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86 Annie Li
` (6 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
Below is the sample iASL difference,
* Signature "DSDT"
- * Length 0x000020A3 (8355)
+ * Length 0x00002159 (8537)
* Revision 0x01 **** 32-bit table (V1), no 64-bit math support
- * Checksum 0x37
+ * Checksum 0x40
* 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
}
@@ -2851,32 +2851,69 @@
{
Memory32Fixed (ReadOnly,
0xFED00000, // Address Base
0x00000400, // Address Length
)
})
}
}
Scope (_GPE)
{
Name (_HID, "ACPI0006" /* GPE Block Device */) // _HID: Hardware ID
}
Scope (_SB)
{
+ Device (\_SB.SLPB)
+ {
+ Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID
+ Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
+ {
+ One,
+ 0x04
+ })
+ OperationRegion (\B**, SystemIO, 0x0201, One)
+ Field (\B**, ByteAcc, NoLock, WriteAsZeros)
+ {
+ SBP, 1,
+ SBW, 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
+ }
+
+ If (\_SB.SLPB.SBW)
+ {
+ \_SB.SLPB.SBW = One
+ Notify (\_SB.SLPB, 0x02) // Device Wake
+ }
+ }
+ }
+
+ Scope (_SB)
+ {
Signed-off-by: Annie Li <annie.li@oracle.com>
---
tests/data/acpi/x86/pc/DSDT | Bin 6830 -> 7012 bytes
tests/data/acpi/x86/pc/DSDT.acpierst | Bin 6741 -> 6923 bytes
tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 8155 -> 8337 bytes
tests/data/acpi/x86/pc/DSDT.bridge | Bin 13701 -> 13883 bytes
tests/data/acpi/x86/pc/DSDT.cphp | Bin 7294 -> 7476 bytes
tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 8484 -> 8666 bytes
tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 6781 -> 6963 bytes
tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 3337 -> 3519 bytes
tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 6902 -> 7084 bytes
tests/data/acpi/x86/pc/DSDT.memhp | Bin 8189 -> 8371 bytes
tests/data/acpi/x86/pc/DSDT.nohpet | Bin 6688 -> 6870 bytes
tests/data/acpi/x86/pc/DSDT.numamem | Bin 6836 -> 7018 bytes
tests/data/acpi/x86/pc/DSDT.roothp | Bin 10623 -> 10805 bytes
tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8537 bytes
tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8554 bytes
tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9862 bytes
.../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8816 bytes
tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8583 bytes
tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12150 bytes
tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 13095 bytes
tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33952 bytes
tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 9001 bytes
tests/data/acpi/x86/q35/DSDT.cxl | Bin 9714 -> 9896 bytes
tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10191 bytes
tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8612 bytes
tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8625 bytes
tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8554 bytes
tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9896 bytes
tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9667 bytes
tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13390 bytes
tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8417 bytes
tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8395 bytes
tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8543 bytes
tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8638 bytes
tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 13095 bytes
tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33952 bytes
tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9143 bytes
tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9169 bytes
tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18771 bytes
tests/data/acpi/x86/q35/DSDT.viot | Bin 9464 -> 9646 bytes
tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35900 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 41 ------------------
42 files changed, 41 deletions(-)
diff --git a/tests/data/acpi/x86/pc/DSDT b/tests/data/acpi/x86/pc/DSDT
index c93ad6b7f83a168a1833d7dba1112dd2ab8a431f..b0b15c87db646b018d8247bf2d69422ef308c731 100644
GIT binary patch
delta 207
zcmZ2y`oxUOCD<h-MVf(uQDh^RBwM{ZOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%DRvGs@m03~@i1poj5
delta 24
fcmaE2w$7BxCD<ioofHEDBlkuwNw&>5*}6plUY`dR
diff --git a/tests/data/acpi/x86/pc/DSDT.acpierst b/tests/data/acpi/x86/pc/DSDT.acpierst
index f643fa2d034053fa07f74f095565b64f021d4290..bba488a12192b81fa73dc075fd0b8085e03bb98c 100644
GIT binary patch
delta 207
zcmca=(rw1&66_MfEzQ8d7_*T}lC9pIB|g|GKDx<1Mi0aY_6cy}i1+Yx;c>jc!^aUH
z5EL%N%EZXU65SBvl%F5Z$j!*a7~Loc<~RmB1;jH3JB7zH3iz_c#JdN$iny}H`xuxr
rEYOS5XNDOFQdYo-CeQ}9&<t!NR|A^*aCG(I@euV8<xHEE*o;L0?VvYk
delta 24
fcmeA+yK2Ja66_KZD#gIS7`%~7l5O)%HX{)LR&xe<
diff --git a/tests/data/acpi/x86/pc/DSDT.acpihmat b/tests/data/acpi/x86/pc/DSDT.acpihmat
index 9d3695ff289036856886a093733926667a32a058..118d60fb6690e643a83b8553af491c69707b68c5 100644
GIT binary patch
delta 207
zcmca@KhcrPCD<ioq5=a0<He0!l5F+vEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-NN#I{os0L{2L6#xJL
delta 24
gcmbQ}c-x-KCD<k8wmbs^<B5%2l5CrAvh9!r0B0@;CIA2c
diff --git a/tests/data/acpi/x86/pc/DSDT.bridge b/tests/data/acpi/x86/pc/DSDT.bridge
index 840b45f354ac14c858d0af8fbd31e97949a65d4b..49e6fe5ab3220d1338318e46992d41b1009323cb 100644
GIT binary patch
delta 207
zcmZq8-krnc66_LUZN|XBsI-wwlC9pIB|g|GKDx<1Mi0aY_6cy}i1+Yx;c>jc!^aUH
z5EL%N%EZXU65SBvl%F5Z$j!*a7~Loc<~RmB1;jH3JB7zH3iz_c#JdN$iny}H`xuxr
rEYOS5XNDOFQdYo-CeQ}9&<t!NR|A^*aCG(I@euV8<xHEE*pl@DIbk>v
delta 24
fcmdm;)0)lY66_MvYRbUCD7leKl5O)%wj_N3U-1Vb
diff --git a/tests/data/acpi/x86/pc/DSDT.cphp b/tests/data/acpi/x86/pc/DSDT.cphp
index dbc0141b2bbc77a6d806ff046dc137992c59a899..7e67a101b6df7e06299ce35bc8becc7cedd87c5f 100644
GIT binary patch
delta 207
zcmexovBiqZCD<jzM3#Ypv0@{aBwM{ZOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%DRvBii10BplJGynhq
delta 24
fcmdmD_0NLKCD<jTPKJSjF@GbMB-`ejY|&x>VsHmV
diff --git a/tests/data/acpi/x86/pc/DSDT.dimmpxm b/tests/data/acpi/x86/pc/DSDT.dimmpxm
index 1294f655d418dbdccc095e0d47ab220869a61a07..3d219cb4ffd801e2c1c005625053d9ccfdedb188 100644
GIT binary patch
delta 207
zcmZ4Dbjz8`CD<k8mLdZKqsvAvUAB66miS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwEMV|ynB0KPXlM*si-
delta 24
fcmccRyu^viCD<iIMUjDl(P|@?F5Bj}Y;UCiTGt0y
diff --git a/tests/data/acpi/x86/pc/DSDT.hpbridge b/tests/data/acpi/x86/pc/DSDT.hpbridge
index 8012b5eb3155377dc7995b73059ecb267d19232c..a95cfee77a843a33f845781e3a5342e3f4f3a5d6 100644
GIT binary patch
delta 207
zcmexsve}HwCD<jzSek)>(PJZ*BwM{ZOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%DRu|<mj06sf6^Z)<=
delta 24
fcmdmN_Sb~VCD<jTR*Hdv(S9SBB-`ejY*8WrUxNn)
diff --git a/tests/data/acpi/x86/pc/DSDT.hpbrroot b/tests/data/acpi/x86/pc/DSDT.hpbrroot
index 4fa0c6fe720f7859f0541b82f828c0329a3c0548..315c7b4ebf08253950974dbde2527f0dfd5bfcf2 100644
GIT binary patch
delta 207
zcmeB_+Aq!J66_MPpO=Aw(PAUl8J2o?miS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwF<%3{I+0Gio2^Z)<=
delta 24
fcmdll-6_T866_Mf$;-gNsJD^p49n&oR$~qTO*jSy
diff --git a/tests/data/acpi/x86/pc/DSDT.ipmikcs b/tests/data/acpi/x86/pc/DSDT.ipmikcs
index 0a891baf458abee4a772ffba7a31914ec22418ec..ad52073a1cd62f6d2349fc750529945eed912612 100644
GIT binary patch
delta 207
zcmexny2hN#CD<iojWh!T<AjY|l5F+vEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-NN#CAml0LfuFA^-pY
delta 24
gcmZ2u{>_xjCD<k8n-l{BWBW!fNw&>5*)EF!0BJ@DGXMYp
diff --git a/tests/data/acpi/x86/pc/DSDT.memhp b/tests/data/acpi/x86/pc/DSDT.memhp
index 9b442a64cf711b33d80691fe84f1d3a6256f943b..2f0398a7c3f170a0ca70b95cc366d7ccba6f19b9 100644
GIT binary patch
delta 207
zcmexszuA$?CD<iovjPJHBilwUNw#`-miS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwEsV!JH~0EP89(f|Me
delta 24
gcmdn&_}8AxCD<k8uRH?-<KK;3l5CrAvfYvd0CAoO;{X5v
diff --git a/tests/data/acpi/x86/pc/DSDT.nohpet b/tests/data/acpi/x86/pc/DSDT.nohpet
index 1754c6878839fc657230e1e714cd7c5142e0a77e..be270fef6dc3ad2587020e62a94444da74eea7ca 100644
GIT binary patch
delta 207
zcmZ2ra?O;>CD<k8niK;A<Gqbs-K_QQEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L{g|$Zn08+a;1ONa4
delta 24
fcmca+y1<0XCD<iIL5hKa@ybT7Zr07-Y~3ONTvrDc
diff --git a/tests/data/acpi/x86/pc/DSDT.numamem b/tests/data/acpi/x86/pc/DSDT.numamem
index 9fc731d3d2bcde5e2612a8ccd81e12098134afe9..8c934dc62026695b7f865f40b2d1e560e984ffe5 100644
GIT binary patch
delta 207
zcmdmD`pS&UCD<h-OPYa!ao<KRNw#`-miS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwEsVw)ra0JHlz#{d8T
delta 24
gcmaE5w#AgoCD<ioixdL`<JOH_l5CrAvP~2L0A{@h*Z=?k
diff --git a/tests/data/acpi/x86/pc/DSDT.roothp b/tests/data/acpi/x86/pc/DSDT.roothp
index e654c83ebe40c413b204c711adcefe3f04655e8c..b51fd1e94b0b9c63ed4cb7360b63ec843cb82ccc 100644
GIT binary patch
delta 207
zcmew#v^9jwCD<jzREvRualu9|Nw#`-miS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwEsVvAJ<0Kow`t^fc4
delta 24
fcmdlQ@;`{nCD<jTUXy`=ar#CsNw&>5*<zFdX?h30
diff --git a/tests/data/acpi/x86/q35/DSDT b/tests/data/acpi/x86/q35/DSDT
index fb89ae0ac6d4346e33156e9e4d3718698a0a1a8e..2a566507daaa72fd978be9928c1def349a151a55 100644
GIT binary patch
delta 207
zcmZ4Nc+-i?CD<h-Qjvjy(P1MOyJWpPOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%C`NKR%407T+ADgXcg
delta 24
gcmccVwAhi$CD<iou>u1FqxnWIcFE1hB`2{10AK<KI{*Lx
diff --git a/tests/data/acpi/x86/q35/DSDT.acpierst b/tests/data/acpi/x86/q35/DSDT.acpierst
index 46fd25400b7c00ee9149ddb64cb5d5bd73f6a82b..cebd8d296b6c68ab647a622ff3fcd6fde25ae2ca 100644
GIT binary patch
delta 207
zcmdnu_{xdPCD<h-OOb(r@xewecFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kX*tJ0Olq+4gdfE
delta 24
gcmaFmw8fFjCD<ioivj}!<MoYP?2?<0OD<*y0BUgv9{>OV
diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat b/tests/data/acpi/x86/q35/DSDT.acpihmat
index 61c5bd52a42242e85090934e8e45bf01642609d6..35168cd8b1af3aca861350a1fd8d6513005cb47f 100644
GIT binary patch
delta 207
zcmccM-R8^X66_MvrpCa)_;({0yJWpPOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%C`NFLw;0PP_;IsgCw
delta 24
gcmZqkz2ME|66_LkL6w1l@ykXocFE1hCHM0H0BDg2O8@`>
diff --git a/tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator b/tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator
index 3aaa2bbdf54a0d0cade14421e84c6ec5a42f96fa..66b8c54802028a1817699aa61464ff3b24f3e672 100644
GIT binary patch
delta 207
zcmdnx{K19GCD<jTK#75Y@z_Q#cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kX*$90OZ~|5&!@I
delta 24
gcmez1vdfvvCD<iomm&iL<KB&2?2?<0ORnSq0BcSNBLDyZ
diff --git a/tests/data/acpi/x86/q35/DSDT.applesmc b/tests/data/acpi/x86/q35/DSDT.applesmc
index 944209adeaa5bbb722431161c404cb51b8209993..01eceb0596f51077bda38bcda1ca34ed3c3608fc 100644
GIT binary patch
delta 207
zcmccU*zU~b66_MvuE@Z^Xt0rsU9#StB|g|GKDx<1Mi0aY_6cy}i1+Yx;c>jc!^aUH
z5EL%N%EZXU65SBvl%F5Z$j!*a7~Loc<~RmB1;jH3JB7zH3iz_c#JdN$iny}H`xuxr
sEYOS5XNDOFQdYo-CeQ}9&<t!NR|A^*aCG(I@euV8<xHCeBoDF!06`WwQvd(}
delta 24
fcmZp7zUav166_LkQGtPhQGFv9yX5BMk_XrUUdsn$
diff --git a/tests/data/acpi/x86/q35/DSDT.bridge b/tests/data/acpi/x86/q35/DSDT.bridge
index d9938dba8fa5d405f7696c0dbdc24f3ae42ec934..2e0bf9da001069e1b2392a755349d35776ac6400 100644
GIT binary patch
delta 207
zcmX>Q`z?;kCD<jTOrL>)F=itdyJWpPOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%C`NNx}X0M`CF4gdfE
delta 24
gcmewscOaI_CD<k8fF1(_WAH{UcFE1hCD)4r0Bzq09{>OV
diff --git a/tests/data/acpi/x86/q35/DSDT.core-count b/tests/data/acpi/x86/q35/DSDT.core-count
index a24b04cbdbf09383b933a42a2a15182545543a87..8b2f64692c87800caeaddc4edefc78a3a82269f4 100644
GIT binary patch
delta 207
zcmeyEvOJB;CD<iI-I#%aamPk3cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kW7>W0M-~d#Q*>R
delta 24
fcmZ3U_A!OaCD<jT(1?M7as5UvcFE1hB@-k8YK;fh
diff --git a/tests/data/acpi/x86/q35/DSDT.core-count2 b/tests/data/acpi/x86/q35/DSDT.core-count2
index 3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8..93e073386675dc5c8bffca451ec04f7a3148bdb0 100644
GIT binary patch
delta 209
zcmaFW&a|MDiOVI}C1gPh0|O)1MlN>AdUuxiV5j)#Ci@sY5F^+pz=<Q?!_$Sw@d6JY
zM|?m~xDYE7BNt0_LyS{?emo;LBNJnEqac{$80-`f&lv0!9?vM?%N7&w9^fkC$`<cq
uV9u~WFGimkW*|se0VA3~8`wfKu#H>|XzIh!)rZGJ)I*drZ5EKcl?4DKG&$!0
delta 26
icmZ3`$@Hq7iOVI}CFE5z0|O)DMlN>A&BrBgW&r?sY6$oM
diff --git a/tests/data/acpi/x86/q35/DSDT.cphp b/tests/data/acpi/x86/q35/DSDT.cphp
index 20955d0aa30120553da35d5a6640055d26255cf9..b9ff78bcf6b3ebbeabba3ddbc65ee340a00210f8 100644
GIT binary patch
delta 207
zcmezDveJ#qCD<iIQ<;H*amhw5cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kWA(T0E{d+SpWb4
delta 24
fcmZ4K_SuEYCD<jTSc!pwarQ<ocFE1hC6hP-W77v}
diff --git a/tests/data/acpi/x86/q35/DSDT.cxl b/tests/data/acpi/x86/q35/DSDT.cxl
index afcdc0d0ba8e41bb70ac20a78dcc8562ca0cb74b..cb55b14647fca8330ef7d9489e961acf036f4462 100644
GIT binary patch
delta 207
zcmez5y~3BvCD<iog&G3`<BN@4?2`5FEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao+*~04}3BtpET3
delta 24
gcmZ4C`^lTjCD<k8lPUuP<Nb|X?2?<0OFrZQ0B{`$z5oCK
diff --git a/tests/data/acpi/x86/q35/DSDT.dimmpxm b/tests/data/acpi/x86/q35/DSDT.dimmpxm
index 228374b55bd544116e359f659e546fc66cf8a895..7efcc7fdc619d9bec6cd44e99d6db7a04efc6dcd 100644
GIT binary patch
delta 207
zcmbQ~cix}NCD<k8ygCB|W5Gr)X~}wbmiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwEsk^IUF0NtQDYybcN
delta 24
fcmX@_KhuxPCD<iIQk{W;F>NE4wB+X7l3#cMTsjAR
diff --git a/tests/data/acpi/x86/q35/DSDT.ipmibt b/tests/data/acpi/x86/q35/DSDT.ipmibt
index 45f911ada5645f158f3d6c0c430ec1d52cadc5d8..cf39dc40f1f4da9ba1d7eca6cfcf65ff502f12c2 100644
GIT binary patch
delta 207
zcmaFoxWt*uCD<ioi6R37W64G?cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>ki5qZ0J*L?3jhEB
delta 24
gcmZ4D{LYcfCD<k8odN>`WA;WacFE1hCGWBW0BDv78~^|S
diff --git a/tests/data/acpi/x86/q35/DSDT.ipmismbus b/tests/data/acpi/x86/q35/DSDT.ipmismbus
index e5d6811bee1233d74236453c49060390d74d4416..1cc3fe668839663e748a3a41de95edcdcffceb66 100644
GIT binary patch
delta 207
zcmezExY3!*CD<ioqap(X<I{~??2`5FEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao-dd04@SKumAu6
delta 24
gcmdn!{M(VsCD<k8w*mtL<DHFM?2?<0OTJ<U0B|!1!2kdN
diff --git a/tests/data/acpi/x86/q35/DSDT.ivrs b/tests/data/acpi/x86/q35/DSDT.ivrs
index 46fd25400b7c00ee9149ddb64cb5d5bd73f6a82b..cebd8d296b6c68ab647a622ff3fcd6fde25ae2ca 100644
GIT binary patch
delta 207
zcmdnu_{xdPCD<h-OOb(r@xewecFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kX*tJ0Olq+4gdfE
delta 24
gcmaFmw8fFjCD<ioivj}!<MoYP?2?<0OD<*y0BUgv9{>OV
diff --git a/tests/data/acpi/x86/q35/DSDT.memhp b/tests/data/acpi/x86/q35/DSDT.memhp
index 5ce081187a578ba7145a9ba20d30be36c13b7663..ee8f4837005d3a048f2a62bfda4a3011d4142746 100644
GIT binary patch
delta 207
zcmez5y~3BvCD<iog&G3`qtQk#cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kbJ}g0Ht0y_W%F@
delta 24
gcmZ4C`^lTjCD<k8lPUuPqvl2~cFE1hB_Hwt0BHdT2mk;8
diff --git a/tests/data/acpi/x86/q35/DSDT.mmio64 b/tests/data/acpi/x86/q35/DSDT.mmio64
index bdf36c4d575bfc4eb2eac3f00c9b7b4270f88677..ffcd7613dfe1bbaa2b5ee20629353c56494c29bd 100644
GIT binary patch
delta 207
zcmeD6I_%Bm66_LkSe1c+@$*J5cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>ko?OH01VDKp8x;=
delta 24
fcmX@?-Rs5W66_MftIEK@_;Mo`yX5BMl7F}XT;d0?
diff --git a/tests/data/acpi/x86/q35/DSDT.multi-bridge b/tests/data/acpi/x86/q35/DSDT.multi-bridge
index 1db43a69e4c2affd8bd678bbef4d3c228380288e..c7e20414146854c2c3be401dccd1c11d52a5f898 100644
GIT binary patch
delta 207
zcmbP{elCN{CD<jz&xC=2F?1sryJWpPOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%C`NOnj80EPKDg#Z8m
delta 24
fcmX??F(aMJCD<iohA{&Jqt8YzcFE1hCEKL{WyA-T
diff --git a/tests/data/acpi/x86/q35/DSDT.noacpihp b/tests/data/acpi/x86/q35/DSDT.noacpihp
index 8bc16887e1c963c61aaecf71712a09c0554f6d67..030f4429a3da37b24660b931dc8642d937e073b6 100644
GIT binary patch
delta 207
zcmZ4O@X(RVCD<k8p#lQ~<CTqEyTt3=S>l78;-j1FWAs3bV4nadj(87G7aqq8JbWDS
z0YTwHtW1ntEYS@yPWk!qjNFV&jM0sPV2)$3Q$Rdpuv2(Eqku14OuT!5tB5OGypMr7
s!veh+eP)<}AY}!NXaa3u3(debay6i-4@XxY9uH9uQO>mauy_Us0Iml*ivR!s
delta 24
fcmaFpxY~isCD<iITY-Ur@zh4HUE-UoB+@wmV@U^{
diff --git a/tests/data/acpi/x86/q35/DSDT.nohpet b/tests/data/acpi/x86/q35/DSDT.nohpet
index c13e45e3612646cc2e30f00b3b7e53335da816ea..8b0954ecf4352151ed13d24383a1dc923ae94191 100644
GIT binary patch
delta 207
zcmbR0aN3c}CD<k8v;qSIBiBZ*N{M=RmiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwE^l9<d60I?N0DF6Tf
delta 24
fcmX@@IMsp6CD<iIRDpqkkzpfOrNm}S$w}-0Q@RE_
diff --git a/tests/data/acpi/x86/q35/DSDT.numamem b/tests/data/acpi/x86/q35/DSDT.numamem
index ba6669437e65952f24516ded954b33fe54bdedfb..4ae25f1731fa03ebdc81b2536ceacc067527f783 100644
GIT binary patch
delta 207
zcmZ4Kc;AW3CD<h-UXg);@zq8ycFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>keta50MleR>;M1&
delta 24
gcmccbw9=8wCD<ior2+#3<HL<y?2?<0OU_^i0B9fw{Qv*}
diff --git a/tests/data/acpi/x86/q35/DSDT.pvpanic-isa b/tests/data/acpi/x86/q35/DSDT.pvpanic-isa
index 6ad42873e91c80cef5a42224cb4d31936dad59b4..e5b160f65a401adc26bf4aa87a20558438d8b6b6 100644
GIT binary patch
delta 207
zcmeBh+ULyW66_MPPmzIv@$*J5cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>ko>_80Py2Ea{vGU
delta 24
fcmdnz+~LIK66_Mfp~%3%_;Mo`yX5BMlHb_@S_=n+
diff --git a/tests/data/acpi/x86/q35/DSDT.thread-count b/tests/data/acpi/x86/q35/DSDT.thread-count
index a24b04cbdbf09383b933a42a2a15182545543a87..8b2f64692c87800caeaddc4edefc78a3a82269f4 100644
GIT binary patch
delta 207
zcmeyEvOJB;CD<iI-I#%aamPk3cFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kW7>W0M-~d#Q*>R
delta 24
fcmZ3U_A!OaCD<jT(1?M7as5UvcFE1hB@-k8YK;fh
diff --git a/tests/data/acpi/x86/q35/DSDT.thread-count2 b/tests/data/acpi/x86/q35/DSDT.thread-count2
index 3a0cb8c581c8cc630a2ec21712b7f8b75fcad1c8..93e073386675dc5c8bffca451ec04f7a3148bdb0 100644
GIT binary patch
delta 209
zcmaFW&a|MDiOVI}C1gPh0|O)1MlN>AdUuxiV5j)#Ci@sY5F^+pz=<Q?!_$Sw@d6JY
zM|?m~xDYE7BNt0_LyS{?emo;LBNJnEqac{$80-`f&lv0!9?vM?%N7&w9^fkC$`<cq
uV9u~WFGimkW*|se0VA3~8`wfKu#H>|XzIh!)rZGJ)I*drZ5EKcl?4DKG&$!0
delta 26
icmZ3`$@Hq7iOVI}CFE5z0|O)DMlN>A&BrBgW&r?sY6$oM
diff --git a/tests/data/acpi/x86/q35/DSDT.tis.tpm12 b/tests/data/acpi/x86/q35/DSDT.tis.tpm12
index e381ce4cbf2b11f56a2d0537db4d21acc97450c9..f6028aa3db2bf393e9d8b0808031a9c5da61a1ab 100644
GIT binary patch
delta 207
zcmZp4+wRWg66_MPU73M_v2Y_7yJWpPOMI|Xd~}n2j2?&)>=WR`5%1yY!sB>>hmRvZ
zAShgjm5GsyCAuNTDL+4+k(-f;F}hI@%yA5M3W#S6b_$PY6!2w>iFXfh6>(*Y_c1VM
sSfCf9&kQpVq^y7uO`r{Ip&8glt_C#q;ppna<00xH%9%C`NPgr50EQVj;Q#;t
delta 24
fcmdn)-sr~V66_MfsLa5?n7)yVU2^kr$q$?WR1604
diff --git a/tests/data/acpi/x86/q35/DSDT.tis.tpm2 b/tests/data/acpi/x86/q35/DSDT.tis.tpm2
index a09253042ce4a715922027245de8a2ab7449c5b7..0f97da57b385f7603c14c9b14df5f96b75e1cdcd 100644
GIT binary patch
delta 207
zcmbR3cF~>7CD<k8qA~*mqxMEFcFB5omiS<&_~<747(Eap*eAe=Bi_T)g~#y%4<AQ-
zKv1|4D-$CZOLRkwQ+|FtBR3-xV|1e+nBy4i6cEoC>=Yi)DB#N$6Yn12D&oo(?_*%j
sus|<HpBZK#NLc|Rnm`-aLNl<9Tn%XI!_n1;$3xUZlrwD>kmTk90F8V&1ONa4
delta 24
fcmccUKHH7UCD<iITA6`?QE?*|yX5BMl3ZK>RksEe
diff --git a/tests/data/acpi/x86/q35/DSDT.type4-count b/tests/data/acpi/x86/q35/DSDT.type4-count
index edc23198cdb47a981bcbc82bc8e392b815abb554..b060bcaab7df7e214d1c2a88b9dcbb92638f3383 100644
GIT binary patch
delta 209
zcmbO`k@4~*MlP3Nmylpj1_s6_8@bpe>)l!6gPr1|o9tusK#X9Y04I)k4^I~!#|u1s
z9Pt4`;X<rTj9e_y4KYsn`SFb0j7*Htje=l~W3W>|JY%p^cs!$kFI!B!dw{EmD_gve
ufjPqhy%>FFn1LW=1&n9{ZD0${z&3I<ps5c>S05e^Q4dkhv{^v1S04aYt2w9u
delta 26
icmcaSiE-{kMlP3Nmyo$03=E97H*&E{ZayyAqYnUiF9^8+
diff --git a/tests/data/acpi/x86/q35/DSDT.viot b/tests/data/acpi/x86/q35/DSDT.viot
index 64e81f571120e3eb2b8c6c9545293a78c75b7bbd..76623a06727ef11cce63c7f2abe0001199ca6896 100644
GIT binary patch
delta 207
zcmez2xz3x*CD<ioohkzZ<J*l~?2`5FEb+lk@zG88F?t|Iuup&!N4$rp3y<Rk9zKrv
zfS_<8RwhO+mgt5Ur~LeQMs7wX#^^>tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4
sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao+qD06fMy!~g&Q
delta 24
gcmZ4I{lk;XCD<k8hYAA&<CBeC?2?<0OFriY0C8dn)c^nh
diff --git a/tests/data/acpi/x86/q35/DSDT.xapic b/tests/data/acpi/x86/q35/DSDT.xapic
index d4acd851c62c956436a436f9fa6d08fc5f370fa7..21e0b9c63973933c7ed68c602322a940bae20e2c 100644
GIT binary patch
delta 209
zcmZph&a`I+6PHV{ONdPm0|Vo?ja=-K_3kY3!A|kfP4+Q*AV#oHfD=c&ho=jV;{_f*
zj`)C}a3NMEMlP1<h8U;({CGxgMkdDSMnN#gG1w^}o-x=dJf2a&mn|mVJ-}7Ol`Y=K
uz?@-$UW`67%s`N`0!B1}Hn4?eU>ms_(A0;cs}GNdsD~(L+AJVhRs;ZS7di3(
delta 26
icmdlpgQ;yg6PHV{OGsNc0|VpRja=-Kn~zJD76AZxDG37r
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 512d40665d..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,42 +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-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",
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (4 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event Annie Li
` (5 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
The GPE event is triggered to notify the guest to suppend or
wakeup itself.
Signed-off-by: Annie Li <annie.li@oracle.com>
---
hw/acpi/core.c | 17 +++++++++++++----
hw/core/machine-qmp-cmds.c | 2 ++
include/hw/acpi/acpi.h | 1 +
include/hw/acpi/acpi_dev_interface.h | 1 +
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index ec5e127d17..e5c3ff9a54 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -354,6 +354,16 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)
return -1;
}
+void acpi_send_sleep_wakeup_event(void)
+{
+ Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL);
+
+ if (obj) {
+ /* Send _GPE.L07 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);
@@ -369,10 +379,9 @@ static void acpi_notify_wakeup(Notifier *notifier, void *data)
(ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_TIMER_STATUS);
break;
case QEMU_WAKEUP_REASON_OTHER:
- /* ACPI_BITMASK_WAKE_STATUS should be set on resume.
- Pretend that resume was caused by power button */
- ar->pm1.evt.sts |=
- (ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_POWER_BUTTON_STATUS);
+ /* ACPI_BITMASK_WAKE_STATUS should be set on resume. */
+ ar->pm1.evt.sts |= ACPI_BITMASK_WAKE_STATUS;
+ acpi_send_sleep_wakeup_event();
break;
default:
break;
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 770f8189ba..010bba05f3 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -9,6 +9,7 @@
#include "qemu/osdep.h"
#include "hw/acpi/vmgenid.h"
+#include "hw/acpi/acpi.h"
#include "hw/boards.h"
#include "hw/intc/intc.h"
#include "hw/mem/memory-device.h"
@@ -283,6 +284,7 @@ void qmp_system_sleep(Error **errp)
"suspend from running is not supported by this guest");
return;
}
+ acpi_send_sleep_wakeup_event();
}
void qmp_system_powerdown(Error **errp)
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index e0e51e85b4..07e31aa138 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -181,6 +181,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_wakeup_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
--- a/include/hw/acpi/acpi_dev_interface.h
+++ b/include/hw/acpi/acpi_dev_interface.h
@@ -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"
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (5 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86 Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt Annie Li
` (4 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
From: Miguel Luis <miguel.luis@oracle.com>
Add support for ACPI GED sleep event on the ACPI device interface so that
HW-reduced systems can enable guests to sleep.
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
hw/acpi/generic_event_device.c | 9 +++++++++
include/hw/acpi/generic_event_device.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index 15b4c3ebbf..934bc65476 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -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) {
diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/generic_event_device.h
index 40af3550b5..9d7496669a 100644
--- a/include/hw/acpi/generic_event_device.h
+++ b/include/hw/acpi/generic_event_device.h
@@ -98,6 +98,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;
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (6 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 09/11] hw/arm: enable sleep support " Annie Li
` (3 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
From: Miguel Luis <miguel.luis@oracle.com>
List changed files for FACP and DSDT table changes for the arm/virt.
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..dcc7c2306d 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,7 @@
/* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/virt/DSDT",
+"tests/data/acpi/virt/DSDT.acpihmatvirt",
+"tests/data/acpi/virt/DSDT.memhp",
+"tests/data/acpi/virt/DSDT.pxb",
+"tests/data/acpi/virt/DSDT.topology",
+"tests/data/acpi/virt/FACP",
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 09/11] hw/arm: enable sleep support for arm/virt
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (7 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button Annie Li
` (2 subsequent siblings)
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
From: Miguel Luis <miguel.luis@oracle.com>
Include the ACPI control method device into arm/virt ACPI tables and the
corresponding handling which enables triggering the event.
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
hw/arm/virt-acpi-build.c | 13 +++++++++++++
hw/arm/virt.c | 13 ++++++++++++-
include/hw/arm/virt.h | 1 +
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index f76fb117ad..ef68d69024 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -41,6 +41,7 @@
#include "hw/acpi/pci.h"
#include "hw/acpi/memory_hotplug.h"
#include "hw/acpi/generic_event_device.h"
+#include "hw/acpi/control_method_device.h"
#include "hw/acpi/tpm.h"
#include "hw/acpi/hmat.h"
#include "hw/pci/pcie_host.h"
@@ -779,6 +780,17 @@ static void build_fadt_rev6(GArray *table_data, BIOSLinker *linker,
.rev = 6,
.minor_ver = 3,
.flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI,
+ /* ACPI 5.0: 4.8.3.7 Sleep Control and Status Registers */
+ .sleep_ctl = {
+ .space_id = AML_AS_SYSTEM_MEMORY,
+ .bit_width = 8,
+ .address = vms->memmap[VIRT_ACPI_GED].base + ACPI_GED_REG_SLEEP_CTL,
+ },
+ .sleep_sts = {
+ .space_id = AML_AS_SYSTEM_MEMORY,
+ .bit_width = 8,
+ .address = vms->memmap[VIRT_ACPI_GED].base + ACPI_GED_REG_SLEEP_STS,
+ },
.xdsdt_tbl_offset = &dsdt_tbl_offset,
};
@@ -858,6 +870,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
}
acpi_dsdt_add_power_button(scope);
+ acpi_dsdt_add_sleep_button(scope);
#ifdef CONFIG_TPM
acpi_dsdt_add_tpm(scope, vms);
#endif
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 687fe0bb8b..6be80f042f 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -677,7 +677,7 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms)
DeviceState *dev;
MachineState *ms = MACHINE(vms);
int irq = vms->irqmap[VIRT_ACPI_GED];
- uint32_t event = ACPI_GED_PWR_DOWN_EVT;
+ uint32_t event = ACPI_GED_PWR_DOWN_EVT | ACPI_GED_SLEEP_EVT;
if (ms->ram_slots) {
event |= ACPI_GED_MEM_HOTPLUG_EVT;
@@ -996,6 +996,14 @@ static void create_rtc(const VirtMachineState *vms)
g_free(nodename);
}
+static void virt_sleep_req(Notifier *n, void *opaque)
+{
+ VirtMachineState *s = container_of(n, VirtMachineState, sleep_notifier);
+
+ if (s->acpi_dev) {
+ acpi_send_event(s->acpi_dev, ACPI_SLEEP_STATUS);
+ }
+}
static DeviceState *gpio_key_dev;
static void virt_powerdown_req(Notifier *n, void *opaque)
{
@@ -2393,6 +2401,9 @@ static void machvirt_init(MachineState *machine)
create_gpio_devices(vms, VIRT_SECURE_GPIO, secure_sysmem);
}
+ /* connect sleep request */
+ vms->sleep_notifier.notify = virt_sleep_req;
+
/* connect powerdown request */
vms->powerdown_notifier.notify = virt_powerdown_req;
qemu_register_powerdown_notifier(&vms->powerdown_notifier);
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index a4d937ed45..75725d8740 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -175,6 +175,7 @@ struct VirtMachineState {
DeviceState *gic;
DeviceState *acpi_dev;
Notifier powerdown_notifier;
+ Notifier sleep_notifier;
PCIBus *bus;
char *oem_id;
char *oem_table_id;
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (8 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 09/11] hw/arm: enable sleep support " Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 11/11] arm/virt: enable sleep support Annie Li
2024-10-07 13:41 ` [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Igor Mammedov
11 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
From: Miguel Luis <miguel.luis@oracle.com>
[000h 0000 4] Signature : "FACP" [Fixed ACPI Description Table (FADT)]
[004h 0004 4] Table Length : 00000114
[008h 0008 1] Revision : 06
-[009h 0009 1] Checksum : 12
+[009h 0009 1] Checksum : DF
[00Ah 0010 6] Oem ID : "BOCHS "
[010h 0016 8] Oem Table ID : "BXPC "
[018h 0024 4] Oem Revision : 00000001
[01Ch 0028 4] Asl Compiler ID : "BXPC"
[020h 0032 4] Asl Compiler Revision : 00000001
[024h 0036 4] FACS Address : 00000000
[028h 0040 4] DSDT Address : 00000000
[02Ch 0044 1] Model : 00
[02Dh 0045 1] PM Profile : 00 [Unspecified]
[02Eh 0046 2] SCI Interrupt : 0000
[030h 0048 4] SMI Command Port : 00000000
[034h 0052 1] ACPI Enable Value : 00
[035h 0053 1] ACPI Disable Value : 00
[036h 0054 1] S4BIOS Command : 00
[037h 0055 1] P-State Control : 00
@@ -148,50 +148,50 @@
[0DCh 0220 1] Space ID : 00 [SystemMemory]
[0DDh 0221 1] Bit Width : 00
[0DEh 0222 1] Bit Offset : 00
[0DFh 0223 1] Encoded Access Width : 00 [Undefined/Legacy]
[0E0h 0224 8] Address : 0000000000000000
[0E8h 0232 12] GPE1 Block : [Generic Address Structure]
[0E8h 0232 1] Space ID : 00 [SystemMemory]
[0E9h 0233 1] Bit Width : 00
[0EAh 0234 1] Bit Offset : 00
[0EBh 0235 1] Encoded Access Width : 00 [Undefined/Legacy]
[0ECh 0236 8] Address : 0000000000000000
[0F4h 0244 12] Sleep Control Register : [Generic Address Structure]
[0F4h 0244 1] Space ID : 00 [SystemMemory]
-[0F5h 0245 1] Bit Width : 00
+[0F5h 0245 1] Bit Width : 08
[0F6h 0246 1] Bit Offset : 00
[0F7h 0247 1] Encoded Access Width : 00 [Undefined/Legacy]
-[0F8h 0248 8] Address : 0000000000000000
+[0F8h 0248 8] Address : 0000000009080000
[100h 0256 12] Sleep Status Register : [Generic Address Structure]
[100h 0256 1] Space ID : 00 [SystemMemory]
-[101h 0257 1] Bit Width : 00
+[101h 0257 1] Bit Width : 08
[102h 0258 1] Bit Offset : 00
[103h 0259 1] Encoded Access Width : 00 [Undefined/Legacy]
-[104h 0260 8] Address : 0000000000000000
+[104h 0260 8] Address : 0000000009080001
[10Ch 0268 8] Hypervisor ID : 00000000554D4551
Raw Table Data: Length 276 (0x114)
- 0000: 46 41 43 50 14 01 00 00 06 12 42 4F 43 48 53 20 // FACP......BOCHS
+ 0000: 46 41 43 50 14 01 00 00 06 DF 42 4F 43 48 53 20 // FACP......BOCHS
0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC
0020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0070: 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0080: 00 03 00 03 00 00 00 00 00 00 00 00 00 00 00 00 // ................
0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
- 00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
- 0100: 00 00 00 00 00 00 00 00 00 00 00 00 51 45 4D 55 // ............QEMU
+ 00F0: 00 00 00 00 00 08 00 00 00 00 08 09 00 00 00 00 // ................
+ 0100: 00 08 00 00 01 00 08 09 00 00 00 00 51 45 4D 55 // ............QEMU
0110: 00 00 00 00 // ....
* Original Table Header:
* Signature "DSDT"
- * Length 0x0000144C (5196)
+ * Length 0x0000149E (5278)
* Revision 0x02
- * Checksum 0x1B
+ * Checksum 0x97
* 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 (C000)
{
Name (_HID, "ACPI0007" /* Processor Device */) // _HID: Hardware ID
Name (_UID, Zero) // _UID: Unique ID
}
@@ -1876,27 +1876,48 @@
0x00000029,
}
})
OperationRegion (EREG, SystemMemory, 0x09080000, 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 (\_SB.SLPB)
+ {
+ Name (_HID, EisaId ("PNP0C0E") /* Sleep Button Device */) // _HID: Hardware ID
+ Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
+ {
+ One,
+ 0x04
+ })
+ OperationRegion (\B**, SystemIO, 0x0201, One)
+ Field (\B**, ByteAcc, NoLock, WriteAsZeros)
+ {
+ SBP, 1,
+ SBW, 1
+ }
+ }
}
}
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5278 bytes
.../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5364 bytes
tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6639 bytes
tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7761 bytes
tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5480 bytes
tests/data/acpi/aarch64/virt/FACP | Bin 276 -> 276 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 6 ------
7 files changed, 6 deletions(-)
diff --git a/tests/data/acpi/aarch64/virt/DSDT b/tests/data/acpi/aarch64/virt/DSDT
index 36d3e5d5a5e47359b6dcb3706f98b4f225677591..348e66bcd52ca4a2c0bb751ac7fc0dd5f36f73c5 100644
GIT binary patch
delta 146
zcmX@3F;A1rCD<ioo(Ka2)AWg4(oCK18`WnBGdXiiJ}4Zltrzba7Q$KJ8tm$mus~pP
zbpjU?0~b?UKzNW7R|7;qfPqV(E!ZbuvYv>XV|0^!j9z@OQ#??>i6h>_(}l<J0uLWY
qd_YjR5GxZS7fW<Qj8lGoJR>(F6JvCvAeiGA>=Y2s80-`t&j<jVM<)CL
delta 63
zcmbQIc}9cFCD<jzM}&caNqQoeG*i3NM)euOOit{R4+;lM$;P{eg>V+Q2D|zsED)Gn
ToxsJ!z{S)S5FRwyUPKN67!MG;
diff --git a/tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt b/tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt
index e6154d0355f84fdcc51387b4db8f9ee63acae4e9..919a08d1fb2aae5664d65c9e29164a2c10b261db 100644
GIT binary patch
delta 148
zcmZ3a`9+h<CD<k8iwFY)Q^-UvX{LUkjq2}&nVdN$i;Dy^>P^lTk;z>kFu6K`OMrn(
zpe@)Zz=^9Nx=Au1JjjV7-ow*{H^48zz}di=fg?WD(}f|r$v#FeKG-Q9q!O%v$MFIW
sA4hyZP`D5)6C)Q(bVH0&ettY7HzN~cbfX}c;~4A|5YHIw6dunA0JnK2!vFvP
delta 66
zcmeyOxk!`CCD<iokq83=(~XH-(oDVX8`a+lGdZzO78eO-l%1R{A|oB$BpDDM<irv0
W;pxH~;1^)vY~akm5g+R5!T<nyRS|Ij
diff --git a/tests/data/acpi/aarch64/virt/DSDT.memhp b/tests/data/acpi/aarch64/virt/DSDT.memhp
index 33f011d6b635035a04c0b39ce9b4e219f7ae74b7..9e713db27df6502c8d7a1cbd2dfddaada3863de4 100644
GIT binary patch
delta 126
zcmbPh{N9+$CD<k8y(9wz)A5O1(o9`*Hmc7MW^&@5d{8);$(MDqn1~nu0)ffZ30wjU
zTmo&uJ^@af<3#LP9iyA<WAx&Ko#H`49Pu8WE<BDGc=$Nt1A@YZSeY2PSfU$ZobvPI
Z8Mzsm7^52n!5qh6r+|3IV5jhSMgZvrA_)Kh
delta 44
zcmaEFJlB}ZCD<iot|S8klg&gfX{L_p8`WnBGdXfiJ}4Z_<ij#qOvGz*p@=Oj03*B%
AQ~&?~
diff --git a/tests/data/acpi/aarch64/virt/DSDT.pxb b/tests/data/acpi/aarch64/virt/DSDT.pxb
index c0fdc6e9c1396cc2259dc4bc665ba023adcf4c9b..95a4075dae670f6f039338ac19ac44eb8b7f6a66 100644
GIT binary patch
delta 123
zcmexwebI)?CD<h-P>z9tiFqQIG*i!`jq2XAOwJsWOJsu?^(LQ?mEl_;Fu6K`OMrn(
zpe@)ZVDdv*ImhTG`xw3WV5fMXfD=c&ho=jV;{_f*j`)C}a3NMEMlP1<h8U;({CGxg
XMkdDSMnN#gG1w^}o-x=dJf0B%TvZ_~
delta 66
zcmca;^WU1wCD<k8zbpd-Q^!OuX{N5b8`ZsKnVi@sm&gV)%1%BZD<d7<BpDDM<irv0
W;pxH~;1^)vY~akm5g+R5!T<oW?Gmg2
diff --git a/tests/data/acpi/aarch64/virt/DSDT.topology b/tests/data/acpi/aarch64/virt/DSDT.topology
index 029d03eecc4efddc001e5377e85ac8e831294362..5a513726f3659c2af590bf852a0ffb4c8a52d3c2 100644
GIT binary patch
delta 123
zcmbQH^+JowCD<h-LzIDmse2-qG*ffPM)f2SCTEVx-6Fw^dXw*q$nY%?m|UH}CBVQX
z&=%|yF!_gwoMUv8eT-gwuv0uxz=<Q?!_$Sw@d6JYM|?m~xDYE7BNt0_LyS{?emo;L
XBNJnEqac{$80-`f&lv0!9?u8>I`AOw
delta 42
ycmaE%HBF1lCD<iIOq79viGL!OG*hGhM)f2SCMWjE-6Fw^vXk$N$V}!Dl?DLi4hnq$
diff --git a/tests/data/acpi/aarch64/virt/FACP b/tests/data/acpi/aarch64/virt/FACP
index da0c3644cc4536a0a0141603ed470bd11492b678..d8f3658df25a63b6994ee135ad3006a3e1f48e89 100644
GIT binary patch
delta 50
tcmbQjG=+)F&CxkPgpq-P?fyir*YX?;K)}HXA{l^eMkqVb)i)F*1OU=O23r6C
delta 30
kcmbQjG=+)F&CxkPgpq-PO=u$5>xl;99D%OBp$tF(0A~>f8~^|S
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dcc7c2306d..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,7 +1 @@
/* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/virt/DSDT",
-"tests/data/acpi/virt/DSDT.acpihmatvirt",
-"tests/data/acpi/virt/DSDT.memhp",
-"tests/data/acpi/virt/DSDT.pxb",
-"tests/data/acpi/virt/DSDT.topology",
-"tests/data/acpi/virt/FACP",
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [RFC V2 PATCH 11/11] arm/virt: enable sleep support
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (9 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button Annie Li
@ 2024-09-27 18:39 ` Annie Li
2024-10-08 11:53 ` Peter Maydell
2024-10-07 13:41 ` [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Igor Mammedov
11 siblings, 1 reply; 23+ messages in thread
From: Annie Li @ 2024-09-27 18:39 UTC (permalink / raw)
To: qemu-devel, qemu-arm, imammedo
Cc: dave, mst, anisinha, shannon.zhaosl, peter.maydell, eduardo,
marcel.apfelbaum, philmd, wangyanan55, zhao1.liu, pbonzini,
richard.henderson, eblake, armbru, annie.li, miguel.luis
From: Miguel Luis <miguel.luis@oracle.com>
For reference: qmp_system_sleep relies on wakeup support delegated
by qemu_wakeup_suspend_enabled() hence the need for calling
qemu_register_wakeup_support(). With this, we should be able to
issue QMP system_sleep command now.
Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
---
hw/arm/virt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 6be80f042f..370ee4fe7f 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2403,6 +2403,7 @@ static void machvirt_init(MachineState *machine)
/* connect sleep request */
vms->sleep_notifier.notify = virt_sleep_req;
+ qemu_register_wakeup_support();
/* connect powerdown request */
vms->powerdown_notifier.notify = virt_powerdown_req;
--
2.43.5
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
@ 2024-10-07 12:44 ` Igor Mammedov
2024-10-08 15:21 ` Annie Li
0 siblings, 1 reply; 23+ messages in thread
From: Igor Mammedov @ 2024-10-07 12:44 UTC (permalink / raw)
To: Annie Li
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On Fri, 27 Sep 2024 14:38:56 -0400
Annie Li <annie.li@oracle.com> wrote:
> 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.
>
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
> hmp-commands.hx | 14 ++++++++++++++
> hw/core/machine-hmp-cmds.c | 5 +++++
> hw/core/machine-qmp-cmds.c | 9 +++++++++
> include/monitor/hmp.h | 1 +
> qapi/machine.json | 18 ++++++++++++++++++
> qapi/pragma.json | 1 +
> 6 files changed, 48 insertions(+)
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 06746f0afc..4c149f403f 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -639,6 +639,20 @@ SRST
> whether profiling is on or off.
> ERST
>
> + {
> + .name = "system_sleep",
> + .args_type = "",
> + .params = "",
> + .help = "send ACPI sleep event",
> + .cmd = hmp_system_sleep,
> + },
> +
> +SRST
> +``system_sleep``
> + Push the virtual sleep button; if supported the system will enter
> + an ACPI sleep state.
perhaps comma after 'if supported'
> +ERST
> +
> {
> .name = "system_reset",
> .args_type = "",
> diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
> index 8701f00cc7..3ee529d8d5 100644
> --- a/hw/core/machine-hmp-cmds.c
> +++ b/hw/core/machine-hmp-cmds.c
> @@ -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);
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 130217da8f..770f8189ba 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -276,6 +276,15 @@ 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 guest");
it's machine and not the guest that doesn't support, isn't it?
> + return;
> + }
I'd reorder this after 6/11, to avoid adding function that does nothing
and then explaining why it is done this way.
> +}
> +
> void qmp_system_powerdown(Error **errp)
> {
> qemu_system_powerdown_request();
> diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
> index ae116d9804..e543eec109 100644
> --- a/include/monitor/hmp.h
> +++ b/include/monitor/hmp.h
> @@ -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);
> diff --git a/qapi/machine.json b/qapi/machine.json
> index d4317435e7..b32d231aa9 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -362,6 +362,24 @@
> ##
> { 'command': 'system_reset' }
>
> +##
> +# @system_sleep:
> +#
> +# Requests that a guest perform a ACPI sleep transition by pushing a virtual
> +# sleep button.
> +#
> +# .. 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:
> #
> diff --git a/qapi/pragma.json b/qapi/pragma.json
> index 59fbe74b8c..e2c5dcb829 100644
> --- a/qapi/pragma.json
> +++ b/qapi/pragma.json
> @@ -23,6 +23,7 @@
> 'set_password',
> 'system_powerdown',
> 'system_reset',
> + 'system_sleep',
> 'system_wakeup' ],
> # Commands allowed to return a non-dictionary
> 'command-returns-exceptions': [
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 02/11] acpi: Implement control method sleep button
2024-09-27 18:38 ` [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Annie Li
@ 2024-10-07 12:59 ` Igor Mammedov
2024-10-08 15:22 ` Annie Li
0 siblings, 1 reply; 23+ messages in thread
From: Igor Mammedov @ 2024-10-07 12:59 UTC (permalink / raw)
To: Annie Li
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On Fri, 27 Sep 2024 14:38:57 -0400
Annie Li <annie.li@oracle.com> wrote:
> The control method sleep button is added, as well as its GPE event
> handler.
>
> Co-developed-by: Miguel Luis <miguel.luis@oracle.com>
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
> hw/acpi/control_method_device.c | 54 +++++++++++++++++++++++++
> hw/acpi/meson.build | 1 +
> include/hw/acpi/control_method_device.h | 25 ++++++++++++
> 3 files changed, 80 insertions(+)
>
> diff --git a/hw/acpi/control_method_device.c b/hw/acpi/control_method_device.c
> new file mode 100644
> index 0000000000..f52c190352
> --- /dev/null
> +++ b/hw/acpi/control_method_device.c
> @@ -0,0 +1,54 @@
> +/*
> + * Control method devices
> + *
> + * Copyright (c) 2023 Oracle and/or its affiliates.
> + *
> + *
> + * Authors:
> + * Annie Li <annie.li@oracle.com>
> + *
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
replace it with SPDX-License-Identifier like it's done elsewhere
> + *
> + */
> +
> +#include "qemu/osdep.h"
> +#include "hw/acpi/control_method_device.h"
> +#include "hw/mem/nvdimm.h"
> +
> +void acpi_dsdt_add_sleep_button(Aml *scope)
> +{
> + Aml *dev = aml_device("\\_SB."ACPI_SLEEP_BUTTON_DEVICE);
drop "\\_SB." here and below as well,
> + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0E")));
> + Aml *pkg = aml_package(2);
> + aml_append(pkg, aml_int(0x01));
> + aml_append(pkg, aml_int(0x04));
> + aml_append(dev, aml_name_decl("_PRW", pkg));
> + aml_append(dev, aml_operation_region("\\Boo", AML_SYSTEM_IO,
use some sensible name for opreg
> + aml_int(0x201), 0x1));
> + Aml *field = aml_field("\\Boo", AML_BYTE_ACC, AML_NOLOCK,
> + AML_WRITE_AS_ZEROS);
> + aml_append(field, aml_named_field("SBP", 1));
> + aml_append(field, aml_named_field("SBW", 1));
> + aml_append(dev, field);
> + aml_append(scope, dev);
> +}
also above and below lacks any documentation,
add comments for relevant spec references, like we do with other ACPI
functions. Also perhaps, it's out of order, reviewer has not clue
where from above registers come and how it is supposed to work.
if you invented those registers, there should be a preceding doc patch
that documents them.
Suggest to reorder after patch that implements above registers in hw,
and also comment here where to look for them.
> +
> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope)
> +{
> + Aml *method = aml_method("_L07", 0, AML_NOTSERIALIZED);
> + Aml *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);
> + condition = aml_if(aml_name("\\_SB.SLPB.SBW"));
> + aml_append(condition, aml_store(aml_int(1), aml_name("\\_SB.SLPB.SBW")));
> + aml_append(condition,
> + aml_notify(aml_name("\\_SB."ACPI_SLEEP_BUTTON_DEVICE),
> + aml_int(0x2)));
> + aml_append(method, condition);
> + aml_append(scope, method);
> +}
> diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
> index fa5c07db90..0b4f1b432d 100644
> --- a/hw/acpi/meson.build
> +++ b/hw/acpi/meson.build
> @@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
> acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c'))
> acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.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'))
> diff --git a/include/hw/acpi/control_method_device.h b/include/hw/acpi/control_method_device.h
> new file mode 100644
> index 0000000000..87f8d6fd59
> --- /dev/null
> +++ b/include/hw/acpi/control_method_device.h
> @@ -0,0 +1,25 @@
> +/*
> + * Control method devices
> + *
> + * Copyright (c) 2023 Oracle and/or its affiliates.
> + *
> + *
> + * Authors:
> + * Annie Li <annie.li@oracle.com>
> + *
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + */
> +
> +
> +#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);
> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope);
> +
> +#endif
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86
2024-09-27 18:38 ` [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Annie Li
@ 2024-10-07 13:32 ` Igor Mammedov
2024-10-08 15:33 ` Annie Li
0 siblings, 1 reply; 23+ messages in thread
From: Igor Mammedov @ 2024-10-07 13:32 UTC (permalink / raw)
To: Annie Li
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On Fri, 27 Sep 2024 14:38:59 -0400
Annie Li <annie.li@oracle.com> wrote:
> Adding Control Method Sleep button and its GPE event handler for
> x86.
>
> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
> hw/i386/acpi-build.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 5d4bd2b710..ee62333a03 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -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 "sysemu/tpm.h"
> #include "hw/acpi/tpm.h"
> #include "hw/acpi/vmgenid.h"
> @@ -1527,6 +1528,14 @@ 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);
> +
> + scope = aml_scope("\\_GPE");
> + acpi_dsdt_add_sleep_gpe_event_handler(scope);
instead of having 1-off function, it would be better to inline impl,
here, like we do elsewhere with _Exx methods.
Also given that, series doesn't support wake,
you don't need to copy example from spec related to operation region,
as dedicated GPE event by itself tells us that sleep was requested.
so all you need to do is sending Notify to sleep button device.
> + aml_append(dsdt, scope);
> +
> if (pcmc->legacy_cpu_hotplug) {
> build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
> } else {
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
` (10 preceding siblings ...)
2024-09-27 18:39 ` [RFC V2 PATCH 11/11] arm/virt: enable sleep support Annie Li
@ 2024-10-07 13:41 ` Igor Mammedov
2024-10-08 15:21 ` Annie Li
11 siblings, 1 reply; 23+ messages in thread
From: Igor Mammedov @ 2024-10-07 13:41 UTC (permalink / raw)
To: Annie Li
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On Fri, 27 Sep 2024 14:38:55 -0400
Annie Li <annie.li@oracle.com> wrote:
> The ACPI sleep button can be implemented as a fixed hardware button
> or Control Method Sleep button.
>
> The patch of implementing a fixed hardware sleep button was posted
> here 1). More discussions can be found here 2). Essentially, the
> discussion mainly focuses on whether the sleep button is implemented
> as a fixed hardware button or Control Method Sleep button. The latter
> benefits various architectures since the code can be shared among
> them.
>
> This patch set implements Control Method Sleep button for both x86
> and ARM platform.(The patch set was posted previously here 3). We
> rebase all the patches on QEMU9.1.0 and re-post it).
>
> For x86, a sleep button GPE event handler is implemented, so a GPE
> event is triggered to indicate the OSPM the sleep button is pressed.
> Tests have been done for Linux guest, and Windows Server guest,
> the sleep button works as expected.
>
> For ARM, a GED event is triggered to notify the OSPM. With proper
> debug knobs it is possible to see the guest OSPM acknowledges the
> sleep event:
Series also missed 'microvm', that uses GED
(it's likely the same amount of work as for arm/virt board)
also test all boards you are touching, to make sure you
didn't break them.
Note: commit messages should be more verbose explaining why and what
patches are doing.
PS:
Also keep changelog in cover letter, for a short list of changes
between series revisions,
see '[PATCH v3 0/1] hw/nvme: add atomic write support' for an example
>
> (qemu) system_sleep
> (qemu) [6.744138] exregion-0179 ex_system_memory_space: System-Memory (width 32) R/W 0 Address=0000000009080000
> [6.746003] evmisc-0132 ev_queue_notify_reques: Dispatching Notify on [SLPB] (Device) Value 0x80 (Status Change) Node 00000000f0e6819e
> [6.802873] PM: suspend entry (s2idle)
> [6.806201] Filesystems sync: 0.002 seconds
> [6.807580] Freezing user space processes
> [6.809478] Freezing user space processes completed (elapsed 0.001 seconds)
> [6.810602] OOM killer disabled.
> [6.811111] Freezing remaining freezable tasks
> [6.812953] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> [6.814126] printk: Suspending console(s) (use no_console_suspend to debug)
>
> But that seems to be all, depicting that sleep/wakeup for ARM is broken
> and there are still missing some pieces of the puzzle.
>
> Nonetheless, we would like to take this RFC as an opportunity for updates
> on this subject as possible roadmaps.
>
> 1) https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06478.html
> 2) https://lore.kernel.org/all/20210920095316.2dd133be@redhat.com/T/#mfe24f89778020deeacfe45083f3eea3cf9f55961
> 3) https://lore.kernel.org/all/20231205002143.562-1-annie.li@oracle.com/T/
>
>
> Annie Li (6):
> acpi: hmp/qmp: Add hmp/qmp support for system_sleep
> acpi: Implement control method sleep button
> test/acpi: allow DSDT table changes
> acpi: Support Control Method sleep button for x86
> tests/acpi: Update DSDT tables for Control method sleep button
> acpi: Send the GPE event of suspend and wakeup for x86
>
> Miguel Luis (5):
> hw/acpi: Add ACPI GED support for the sleep event
> tests/acpi: allow FACP and DSDT table changes for arm/virt
> hw/arm: enable sleep support for arm/virt
> tests/acpi: Update FACP and DSDT tables for sleep button
> arm/virt: enable sleep support
>
> hmp-commands.hx | 14 +++++
> hw/acpi/control_method_device.c | 54 ++++++++++++++++++
> hw/acpi/core.c | 17 ++++--
> hw/acpi/generic_event_device.c | 9 +++
> hw/acpi/meson.build | 1 +
> hw/arm/virt-acpi-build.c | 13 +++++
> hw/arm/virt.c | 14 ++++-
> hw/core/machine-hmp-cmds.c | 5 ++
> hw/core/machine-qmp-cmds.c | 11 ++++
> hw/i386/acpi-build.c | 9 +++
> include/hw/acpi/acpi.h | 1 +
> include/hw/acpi/acpi_dev_interface.h | 1 +
> include/hw/acpi/control_method_device.h | 25 ++++++++
> include/hw/acpi/generic_event_device.h | 1 +
> include/hw/arm/virt.h | 1 +
> include/monitor/hmp.h | 1 +
> qapi/machine.json | 18 ++++++
> qapi/pragma.json | 1 +
> tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5278 bytes
> .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5364 bytes
> tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6639 bytes
> tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7761 bytes
> tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5480 bytes
> tests/data/acpi/aarch64/virt/FACP | Bin 276 -> 276 bytes
> tests/data/acpi/x86/pc/DSDT | Bin 6830 -> 7012 bytes
> tests/data/acpi/x86/pc/DSDT.acpierst | Bin 6741 -> 6923 bytes
> tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 8155 -> 8337 bytes
> tests/data/acpi/x86/pc/DSDT.bridge | Bin 13701 -> 13883 bytes
> tests/data/acpi/x86/pc/DSDT.cphp | Bin 7294 -> 7476 bytes
> tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 8484 -> 8666 bytes
> tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 6781 -> 6963 bytes
> tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 3337 -> 3519 bytes
> tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 6902 -> 7084 bytes
> tests/data/acpi/x86/pc/DSDT.memhp | Bin 8189 -> 8371 bytes
> tests/data/acpi/x86/pc/DSDT.nohpet | Bin 6688 -> 6870 bytes
> tests/data/acpi/x86/pc/DSDT.numamem | Bin 6836 -> 7018 bytes
> tests/data/acpi/x86/pc/DSDT.roothp | Bin 10623 -> 10805 bytes
> tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8537 bytes
> tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8554 bytes
> tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9862 bytes
> .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8816 bytes
> tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8583 bytes
> tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12150 bytes
> tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 13095 bytes
> tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33952 bytes
> tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 9001 bytes
> tests/data/acpi/x86/q35/DSDT.cxl | Bin 9714 -> 9896 bytes
> tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10191 bytes
> tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8612 bytes
> tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8625 bytes
> tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8554 bytes
> tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9896 bytes
> tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9667 bytes
> tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13390 bytes
> tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8417 bytes
> tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8395 bytes
> tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8543 bytes
> tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8638 bytes
> tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 13095 bytes
> tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33952 bytes
> tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9143 bytes
> tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9169 bytes
> tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18771 bytes
> tests/data/acpi/x86/q35/DSDT.viot | Bin 9464 -> 9646 bytes
> tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35900 bytes
> 65 files changed, 191 insertions(+), 5 deletions(-)
> create mode 100644 hw/acpi/control_method_device.c
> create mode 100644 include/hw/acpi/control_method_device.h
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support
2024-09-27 18:39 ` [RFC V2 PATCH 11/11] arm/virt: enable sleep support Annie Li
@ 2024-10-08 11:53 ` Peter Maydell
2024-10-10 12:43 ` Miguel Luis
0 siblings, 1 reply; 23+ messages in thread
From: Peter Maydell @ 2024-10-08 11:53 UTC (permalink / raw)
To: miguel.luis
Cc: qemu-devel, qemu-arm, imammedo, dave, mst, anisinha,
shannon.zhaosl, eduardo, marcel.apfelbaum, philmd, wangyanan55,
zhao1.liu, pbonzini, richard.henderson, eblake, armbru, annie.li
On Fri, 27 Sept 2024 at 19:40, Annie Li <annie.li@oracle.com> wrote:
>
> From: Miguel Luis <miguel.luis@oracle.com>
>
> For reference: qmp_system_sleep relies on wakeup support delegated
> by qemu_wakeup_suspend_enabled() hence the need for calling
> qemu_register_wakeup_support(). With this, we should be able to
> issue QMP system_sleep command now.
>
> Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
> ---
> hw/arm/virt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 6be80f042f..370ee4fe7f 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2403,6 +2403,7 @@ static void machvirt_init(MachineState *machine)
>
> /* connect sleep request */
> vms->sleep_notifier.notify = virt_sleep_req;
> + qemu_register_wakeup_support();
On i386 the machine has a MachineClass::wakeup method
(pc_machine_wakeup) that does things on wakeup.
On ppc/spapr there is this comment before the call
to qemu_register_wakeup_support():
/*
* Nothing needs to be done to resume a suspended guest because
* suspending does not change the machine state, so no need for
* a ->wakeup method.
*/
I think that for Arm we need to determine whether the virt
board is like i386/pc (need to do something on wakeup) or
like ppc/spapr (don't need to do anything on wakeup). If the
former, we obviously would need to implement the
MachineClass::wakeup method; if the latter, then we
should have a comment explaining why there doesn't need
to be any action taken on resume and therefore the machine
has no wakeup method.
thanks
-- PMM
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button
2024-10-07 13:41 ` [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Igor Mammedov
@ 2024-10-08 15:21 ` Annie Li
0 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-10-08 15:21 UTC (permalink / raw)
To: Igor Mammedov
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On 10/7/2024 9:41 AM, Igor Mammedov wrote:
> On Fri, 27 Sep 2024 14:38:55 -0400
> Annie Li <annie.li@oracle.com> wrote:
>
>> The ACPI sleep button can be implemented as a fixed hardware button
>> or Control Method Sleep button.
>>
>> The patch of implementing a fixed hardware sleep button was posted
>> here 1). More discussions can be found here 2). Essentially, the
>> discussion mainly focuses on whether the sleep button is implemented
>> as a fixed hardware button or Control Method Sleep button. The latter
>> benefits various architectures since the code can be shared among
>> them.
>>
>> This patch set implements Control Method Sleep button for both x86
>> and ARM platform.(The patch set was posted previously here 3). We
>> rebase all the patches on QEMU9.1.0 and re-post it).
>>
>> For x86, a sleep button GPE event handler is implemented, so a GPE
>> event is triggered to indicate the OSPM the sleep button is pressed.
>> Tests have been done for Linux guest, and Windows Server guest,
>> the sleep button works as expected.
>>
>> For ARM, a GED event is triggered to notify the OSPM. With proper
>> debug knobs it is possible to see the guest OSPM acknowledges the
>> sleep event:
> Series also missed 'microvm', that uses GED
> (it's likely the same amount of work as for arm/virt board)
I haven't implement this for 'microvm' yet, will work on this part, as
well as
things you mentioned below.
Thanks
Annie
>
> also test all boards you are touching, to make sure you
> didn't break them.
>
> Note: commit messages should be more verbose explaining why and what
> patches are doing.
>
> PS:
> Also keep changelog in cover letter, for a short list of changes
> between series revisions,
> see '[PATCH v3 0/1] hw/nvme: add atomic write support' for an example
>
>> (qemu) system_sleep
>> (qemu) [6.744138] exregion-0179 ex_system_memory_space: System-Memory (width 32) R/W 0 Address=0000000009080000
>> [6.746003] evmisc-0132 ev_queue_notify_reques: Dispatching Notify on [SLPB] (Device) Value 0x80 (Status Change) Node 00000000f0e6819e
>> [6.802873] PM: suspend entry (s2idle)
>> [6.806201] Filesystems sync: 0.002 seconds
>> [6.807580] Freezing user space processes
>> [6.809478] Freezing user space processes completed (elapsed 0.001 seconds)
>> [6.810602] OOM killer disabled.
>> [6.811111] Freezing remaining freezable tasks
>> [6.812953] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
>> [6.814126] printk: Suspending console(s) (use no_console_suspend to debug)
>>
>> But that seems to be all, depicting that sleep/wakeup for ARM is broken
>> and there are still missing some pieces of the puzzle.
>>
>> Nonetheless, we would like to take this RFC as an opportunity for updates
>> on this subject as possible roadmaps.
>>
>> 1) https://urldefense.com/v3/__https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06478.html__;!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN323zzSb8$
>> 2) https://urldefense.com/v3/__https://lore.kernel.org/all/20210920095316.2dd133be@redhat.com/T/*mfe24f89778020deeacfe45083f3eea3cf9f55961__;Iw!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN34RUikoM$
>> 3) https://urldefense.com/v3/__https://lore.kernel.org/all/20231205002143.562-1-annie.li@oracle.com/T/__;!!ACWV5N9M2RV99hQ!PLz2MGkywgnU4MB6tbITFe4-fMs6CqdUQY9Jhgbi2vIdAVf94Uz2OI-yBQOYElEQb-dsvtN3zrJlck4$
>>
>>
>> Annie Li (6):
>> acpi: hmp/qmp: Add hmp/qmp support for system_sleep
>> acpi: Implement control method sleep button
>> test/acpi: allow DSDT table changes
>> acpi: Support Control Method sleep button for x86
>> tests/acpi: Update DSDT tables for Control method sleep button
>> acpi: Send the GPE event of suspend and wakeup for x86
>>
>> Miguel Luis (5):
>> hw/acpi: Add ACPI GED support for the sleep event
>> tests/acpi: allow FACP and DSDT table changes for arm/virt
>> hw/arm: enable sleep support for arm/virt
>> tests/acpi: Update FACP and DSDT tables for sleep button
>> arm/virt: enable sleep support
>>
>> hmp-commands.hx | 14 +++++
>> hw/acpi/control_method_device.c | 54 ++++++++++++++++++
>> hw/acpi/core.c | 17 ++++--
>> hw/acpi/generic_event_device.c | 9 +++
>> hw/acpi/meson.build | 1 +
>> hw/arm/virt-acpi-build.c | 13 +++++
>> hw/arm/virt.c | 14 ++++-
>> hw/core/machine-hmp-cmds.c | 5 ++
>> hw/core/machine-qmp-cmds.c | 11 ++++
>> hw/i386/acpi-build.c | 9 +++
>> include/hw/acpi/acpi.h | 1 +
>> include/hw/acpi/acpi_dev_interface.h | 1 +
>> include/hw/acpi/control_method_device.h | 25 ++++++++
>> include/hw/acpi/generic_event_device.h | 1 +
>> include/hw/arm/virt.h | 1 +
>> include/monitor/hmp.h | 1 +
>> qapi/machine.json | 18 ++++++
>> qapi/pragma.json | 1 +
>> tests/data/acpi/aarch64/virt/DSDT | Bin 5196 -> 5278 bytes
>> .../data/acpi/aarch64/virt/DSDT.acpihmatvirt | Bin 5282 -> 5364 bytes
>> tests/data/acpi/aarch64/virt/DSDT.memhp | Bin 6557 -> 6639 bytes
>> tests/data/acpi/aarch64/virt/DSDT.pxb | Bin 7679 -> 7761 bytes
>> tests/data/acpi/aarch64/virt/DSDT.topology | Bin 5398 -> 5480 bytes
>> tests/data/acpi/aarch64/virt/FACP | Bin 276 -> 276 bytes
>> tests/data/acpi/x86/pc/DSDT | Bin 6830 -> 7012 bytes
>> tests/data/acpi/x86/pc/DSDT.acpierst | Bin 6741 -> 6923 bytes
>> tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 8155 -> 8337 bytes
>> tests/data/acpi/x86/pc/DSDT.bridge | Bin 13701 -> 13883 bytes
>> tests/data/acpi/x86/pc/DSDT.cphp | Bin 7294 -> 7476 bytes
>> tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 8484 -> 8666 bytes
>> tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 6781 -> 6963 bytes
>> tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 3337 -> 3519 bytes
>> tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 6902 -> 7084 bytes
>> tests/data/acpi/x86/pc/DSDT.memhp | Bin 8189 -> 8371 bytes
>> tests/data/acpi/x86/pc/DSDT.nohpet | Bin 6688 -> 6870 bytes
>> tests/data/acpi/x86/pc/DSDT.numamem | Bin 6836 -> 7018 bytes
>> tests/data/acpi/x86/pc/DSDT.roothp | Bin 10623 -> 10805 bytes
>> tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8537 bytes
>> tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8554 bytes
>> tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9862 bytes
>> .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8816 bytes
>> tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8583 bytes
>> tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12150 bytes
>> tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 13095 bytes
>> tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33952 bytes
>> tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 9001 bytes
>> tests/data/acpi/x86/q35/DSDT.cxl | Bin 9714 -> 9896 bytes
>> tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10191 bytes
>> tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8612 bytes
>> tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8625 bytes
>> tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8554 bytes
>> tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9896 bytes
>> tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9667 bytes
>> tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13390 bytes
>> tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8417 bytes
>> tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8395 bytes
>> tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8543 bytes
>> tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8638 bytes
>> tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 13095 bytes
>> tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33952 bytes
>> tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9143 bytes
>> tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9169 bytes
>> tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18771 bytes
>> tests/data/acpi/x86/q35/DSDT.viot | Bin 9464 -> 9646 bytes
>> tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35900 bytes
>> 65 files changed, 191 insertions(+), 5 deletions(-)
>> create mode 100644 hw/acpi/control_method_device.c
>> create mode 100644 include/hw/acpi/control_method_device.h
>>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep
2024-10-07 12:44 ` Igor Mammedov
@ 2024-10-08 15:21 ` Annie Li
0 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-10-08 15:21 UTC (permalink / raw)
To: Igor Mammedov
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On 10/7/2024 8:44 AM, Igor Mammedov wrote:
> On Fri, 27 Sep 2024 14:38:56 -0400
> Annie Li <annie.li@oracle.com> wrote:
>
>> 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.
>>
>> Signed-off-by: Annie Li <annie.li@oracle.com>
>> ---
>> hmp-commands.hx | 14 ++++++++++++++
>> hw/core/machine-hmp-cmds.c | 5 +++++
>> hw/core/machine-qmp-cmds.c | 9 +++++++++
>> include/monitor/hmp.h | 1 +
>> qapi/machine.json | 18 ++++++++++++++++++
>> qapi/pragma.json | 1 +
>> 6 files changed, 48 insertions(+)
>>
>> diff --git a/hmp-commands.hx b/hmp-commands.hx
>> index 06746f0afc..4c149f403f 100644
>> --- a/hmp-commands.hx
>> +++ b/hmp-commands.hx
>> @@ -639,6 +639,20 @@ SRST
>> whether profiling is on or off.
>> ERST
>>
>> + {
>> + .name = "system_sleep",
>> + .args_type = "",
>> + .params = "",
>> + .help = "send ACPI sleep event",
>> + .cmd = hmp_system_sleep,
>> + },
>> +
>> +SRST
>> +``system_sleep``
>> + Push the virtual sleep button; if supported the system will enter
>> + an ACPI sleep state.
> perhaps comma after 'if supported'
Sure thing
>
>
>> +ERST
>> +
>> {
>> .name = "system_reset",
>> .args_type = "",
>> diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
>> index 8701f00cc7..3ee529d8d5 100644
>> --- a/hw/core/machine-hmp-cmds.c
>> +++ b/hw/core/machine-hmp-cmds.c
>> @@ -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);
>> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
>> index 130217da8f..770f8189ba 100644
>> --- a/hw/core/machine-qmp-cmds.c
>> +++ b/hw/core/machine-qmp-cmds.c
>> @@ -276,6 +276,15 @@ 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 guest");
> it's machine and not the guest that doesn't support, isn't it?
Not the guest, will change this
>
>> + return;
>> + }
> I'd reorder this after 6/11, to avoid adding function that does nothing
> and then explaining why it is done this way.
OK, will do.
Thanks
Annie
>> +}
>> +
>> void qmp_system_powerdown(Error **errp)
>> {
>> qemu_system_powerdown_request();
>> diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
>> index ae116d9804..e543eec109 100644
>> --- a/include/monitor/hmp.h
>> +++ b/include/monitor/hmp.h
>> @@ -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);
>> diff --git a/qapi/machine.json b/qapi/machine.json
>> index d4317435e7..b32d231aa9 100644
>> --- a/qapi/machine.json
>> +++ b/qapi/machine.json
>> @@ -362,6 +362,24 @@
>> ##
>> { 'command': 'system_reset' }
>>
>> +##
>> +# @system_sleep:
>> +#
>> +# Requests that a guest perform a ACPI sleep transition by pushing a virtual
>> +# sleep button.
>> +#
>> +# .. 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:
>> #
>> diff --git a/qapi/pragma.json b/qapi/pragma.json
>> index 59fbe74b8c..e2c5dcb829 100644
>> --- a/qapi/pragma.json
>> +++ b/qapi/pragma.json
>> @@ -23,6 +23,7 @@
>> 'set_password',
>> 'system_powerdown',
>> 'system_reset',
>> + 'system_sleep',
>> 'system_wakeup' ],
>> # Commands allowed to return a non-dictionary
>> 'command-returns-exceptions': [
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 02/11] acpi: Implement control method sleep button
2024-10-07 12:59 ` Igor Mammedov
@ 2024-10-08 15:22 ` Annie Li
2024-10-11 12:10 ` Igor Mammedov
0 siblings, 1 reply; 23+ messages in thread
From: Annie Li @ 2024-10-08 15:22 UTC (permalink / raw)
To: Igor Mammedov
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
[-- Attachment #1: Type: text/plain, Size: 5420 bytes --]
On 10/7/2024 8:59 AM, Igor Mammedov wrote:
> On Fri, 27 Sep 2024 14:38:57 -0400
> Annie Li<annie.li@oracle.com> wrote:
>
>> The control method sleep button is added, as well as its GPE event
>> handler.
>>
>> Co-developed-by: Miguel Luis<miguel.luis@oracle.com>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>> hw/acpi/control_method_device.c | 54 +++++++++++++++++++++++++
>> hw/acpi/meson.build | 1 +
>> include/hw/acpi/control_method_device.h | 25 ++++++++++++
>> 3 files changed, 80 insertions(+)
>>
>> diff --git a/hw/acpi/control_method_device.c b/hw/acpi/control_method_device.c
>> new file mode 100644
>> index 0000000000..f52c190352
>> --- /dev/null
>> +++ b/hw/acpi/control_method_device.c
>> @@ -0,0 +1,54 @@
>> +/*
>> + * Control method devices
>> + *
>> + * Copyright (c) 2023 Oracle and/or its affiliates.
>> + *
>> + *
>> + * Authors:
>> + * Annie Li<annie.li@oracle.com>
>> + *
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
>> + * See the COPYING file in the top-level directory.
> replace it with SPDX-License-Identifier like it's done elsewhere
Nod
>
>> + *
>> + */
>> +
>> +#include "qemu/osdep.h"
>> +#include "hw/acpi/control_method_device.h"
>> +#include "hw/mem/nvdimm.h"
>> +
>> +void acpi_dsdt_add_sleep_button(Aml *scope)
>> +{
>> + Aml *dev = aml_device("\\_SB."ACPI_SLEEP_BUTTON_DEVICE);
> drop "\\_SB." here and below as well,
Make sense here since the scope parameter is "_SB", but for the "_SB"
in acpi_dsdt_add_sleep_gpe_event_handler where the scope parameter is
"_GPE", I suppose "\\_SB." is necessary.
>
>> + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0E")));
>> + Aml *pkg = aml_package(2);
>> + aml_append(pkg, aml_int(0x01));
>> + aml_append(pkg, aml_int(0x04));
>> + aml_append(dev, aml_name_decl("_PRW", pkg));
>> + aml_append(dev, aml_operation_region("\\Boo", AML_SYSTEM_IO,
> use some sensible name for opreg
will do
>> + aml_int(0x201), 0x1));
>> + Aml *field = aml_field("\\Boo", AML_BYTE_ACC, AML_NOLOCK,
>> + AML_WRITE_AS_ZEROS);
>> + aml_append(field, aml_named_field("SBP", 1));
>> + aml_append(field, aml_named_field("SBW", 1));
>> + aml_append(dev, field);
>> + aml_append(scope, dev);
>> +}
> also above and below lacks any documentation,
> add comments for relevant spec references, like we do with other ACPI
> functions. Also perhaps, it's out of order, reviewer has not clue
> where from above registers come and how it is supposed to work.
>
> if you invented those registers, there should be a preceding doc patch
> that documents them.
>
> Suggest to reorder after patch that implements above registers in hw,
> and also comment here where to look for them.
Thanks for the feedback.
Thanks
Annie
>> +
>> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope)
>> +{
>> + Aml *method = aml_method("_L07", 0, AML_NOTSERIALIZED);
>> + Aml *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);
>> + condition = aml_if(aml_name("\\_SB.SLPB.SBW"));
>> + aml_append(condition, aml_store(aml_int(1), aml_name("\\_SB.SLPB.SBW")));
>> + aml_append(condition,
>> + aml_notify(aml_name("\\_SB."ACPI_SLEEP_BUTTON_DEVICE),
>> + aml_int(0x2)));
>> + aml_append(method, condition);
>> + aml_append(scope, method);
>> +}
>> diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
>> index fa5c07db90..0b4f1b432d 100644
>> --- a/hw/acpi/meson.build
>> +++ b/hw/acpi/meson.build
>> @@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
>> acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c'))
>> acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.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'))
>> diff --git a/include/hw/acpi/control_method_device.h b/include/hw/acpi/control_method_device.h
>> new file mode 100644
>> index 0000000000..87f8d6fd59
>> --- /dev/null
>> +++ b/include/hw/acpi/control_method_device.h
>> @@ -0,0 +1,25 @@
>> +/*
>> + * Control method devices
>> + *
>> + * Copyright (c) 2023 Oracle and/or its affiliates.
>> + *
>> + *
>> + * Authors:
>> + * Annie Li<annie.li@oracle.com>
>> + *
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
>> + * See the COPYING file in the top-level directory.
>> + *
>> + */
>> +
>> +
>> +#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);
>> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope);
>> +
>> +#endif
[-- Attachment #2: Type: text/html, Size: 7704 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86
2024-10-07 13:32 ` Igor Mammedov
@ 2024-10-08 15:33 ` Annie Li
0 siblings, 0 replies; 23+ messages in thread
From: Annie Li @ 2024-10-08 15:33 UTC (permalink / raw)
To: Igor Mammedov
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]
On 10/7/2024 9:32 AM, Igor Mammedov wrote:
> On Fri, 27 Sep 2024 14:38:59 -0400
> Annie Li<annie.li@oracle.com> wrote:
>
>> Adding Control Method Sleep button and its GPE event handler for
>> x86.
>>
>> Signed-off-by: Annie Li<annie.li@oracle.com>
>> ---
>> hw/i386/acpi-build.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
>> index 5d4bd2b710..ee62333a03 100644
>> --- a/hw/i386/acpi-build.c
>> +++ b/hw/i386/acpi-build.c
>> @@ -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 "sysemu/tpm.h"
>> #include "hw/acpi/tpm.h"
>> #include "hw/acpi/vmgenid.h"
>> @@ -1527,6 +1528,14 @@ 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);
>> +
>> + scope = aml_scope("\\_GPE");
>> + acpi_dsdt_add_sleep_gpe_event_handler(scope);
> instead of having 1-off function, it would be better to inline impl,
> here, like we do elsewhere with _Exx methods.
Was thinking that "acpi_dsdt_add_sleep_button" is shared by multiple
platforms, and "acpi_dsdt_add_sleep_gpe_event_handler" is related this
function. However, it totally makes sense to inline this function since
it is only being used once for x86.
>
> Also given that, series doesn't support wake,
> you don't need to copy example from spec related to operation region,
> as dedicated GPE event by itself tells us that sleep was requested.
>
> so all you need to do is sending Notify to sleep button device.
Got it, thanks for the feedback.
Thanks
Annie
>
>> + aml_append(dsdt, scope);
>> +
>> if (pcmc->legacy_cpu_hotplug) {
>> build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
>> } else {
[-- Attachment #2: Type: text/html, Size: 3365 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support
2024-10-08 11:53 ` Peter Maydell
@ 2024-10-10 12:43 ` Miguel Luis
0 siblings, 0 replies; 23+ messages in thread
From: Miguel Luis @ 2024-10-10 12:43 UTC (permalink / raw)
To: Peter Maydell
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Igor Mammedov,
dave@treblig.org, Michael S . Tsirkin, anisinha@redhat.com,
shannon.zhaosl@gmail.com, eduardo@habkost.net,
marcel.apfelbaum@gmail.com, philmd@linaro.org,
wangyanan55@huawei.com, zhao1.liu@intel.com, pbonzini@redhat.com,
richard.henderson@linaro.org, eblake@redhat.com,
armbru@redhat.com, Annie Li
Hi Peter,
> On 8 Oct 2024, at 11:53, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 27 Sept 2024 at 19:40, Annie Li <annie.li@oracle.com> wrote:
>>
>> From: Miguel Luis <miguel.luis@oracle.com>
>>
>> For reference: qmp_system_sleep relies on wakeup support delegated
>> by qemu_wakeup_suspend_enabled() hence the need for calling
>> qemu_register_wakeup_support(). With this, we should be able to
>> issue QMP system_sleep command now.
>>
>> Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
>> ---
>> hw/arm/virt.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 6be80f042f..370ee4fe7f 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -2403,6 +2403,7 @@ static void machvirt_init(MachineState *machine)
>>
>> /* connect sleep request */
>> vms->sleep_notifier.notify = virt_sleep_req;
>> + qemu_register_wakeup_support();
>
> On i386 the machine has a MachineClass::wakeup method
> (pc_machine_wakeup) that does things on wakeup.
>
> On ppc/spapr there is this comment before the call
> to qemu_register_wakeup_support():
> /*
> * Nothing needs to be done to resume a suspended guest because
> * suspending does not change the machine state, so no need for
> * a ->wakeup method.
> */
>
> I think that for Arm we need to determine whether the virt
> board is like i386/pc (need to do something on wakeup) or
> like ppc/spapr (don't need to do anything on wakeup). If the
> former, we obviously would need to implement the
> MachineClass::wakeup method; if the latter, then we
> should have a comment explaining why there doesn't need
> to be any action taken on resume and therefore the machine
> has no wakeup method.
>
I believe it will be needed to reset the cpus and restore context afterwards but
before that I’m yet still to find a reliable wakeup source for the
experiments.
So far I’ve tried the rtc-efi wakeup source but it seems not supporting time in
the future in wakealarm so there’s still pending research on this.
Direction hints for acceptable ways forward are always welcome, of course.
Many thanks for that.
Miguel
> thanks
> -- PMM
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [RFC V2 PATCH 02/11] acpi: Implement control method sleep button
2024-10-08 15:22 ` Annie Li
@ 2024-10-11 12:10 ` Igor Mammedov
0 siblings, 0 replies; 23+ messages in thread
From: Igor Mammedov @ 2024-10-11 12:10 UTC (permalink / raw)
To: Annie Li
Cc: miguel.luis, qemu-devel, qemu-arm, dave, mst, anisinha,
shannon.zhaosl, peter.maydell, eduardo, marcel.apfelbaum, philmd,
wangyanan55, zhao1.liu, pbonzini, richard.henderson, eblake,
armbru
On Tue, 8 Oct 2024 11:22:33 -0400
Annie Li <annie.li@oracle.com> wrote:
> On 10/7/2024 8:59 AM, Igor Mammedov wrote:
> > On Fri, 27 Sep 2024 14:38:57 -0400
> > Annie Li<annie.li@oracle.com> wrote:
> >
> >> The control method sleep button is added, as well as its GPE event
> >> handler.
> >>
> >> Co-developed-by: Miguel Luis<miguel.luis@oracle.com>
> >> Signed-off-by: Annie Li<annie.li@oracle.com>
> >> ---
> >> hw/acpi/control_method_device.c | 54 +++++++++++++++++++++++++
> >> hw/acpi/meson.build | 1 +
> >> include/hw/acpi/control_method_device.h | 25 ++++++++++++
> >> 3 files changed, 80 insertions(+)
> >>
> >> diff --git a/hw/acpi/control_method_device.c b/hw/acpi/control_method_device.c
> >> new file mode 100644
> >> index 0000000000..f52c190352
> >> --- /dev/null
> >> +++ b/hw/acpi/control_method_device.c
> >> @@ -0,0 +1,54 @@
> >> +/*
> >> + * Control method devices
> >> + *
> >> + * Copyright (c) 2023 Oracle and/or its affiliates.
> >> + *
> >> + *
> >> + * Authors:
> >> + * Annie Li<annie.li@oracle.com>
> >> + *
> >> + *
> >> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> >> + * See the COPYING file in the top-level directory.
> > replace it with SPDX-License-Identifier like it's done elsewhere
> Nod
> >
> >> + *
> >> + */
> >> +
> >> +#include "qemu/osdep.h"
> >> +#include "hw/acpi/control_method_device.h"
> >> +#include "hw/mem/nvdimm.h"
> >> +
> >> +void acpi_dsdt_add_sleep_button(Aml *scope)
> >> +{
> >> + Aml *dev = aml_device("\\_SB."ACPI_SLEEP_BUTTON_DEVICE);
> > drop "\\_SB." here and below as well,
> Make sense here since the scope parameter is "_SB", but for the "_SB"
> in acpi_dsdt_add_sleep_gpe_event_handler where the scope parameter is
> "_GPE", I suppose "\\_SB." is necessary.
Check the spec onhow name resolution in ACPI works.
Anyways you likely won't have dedicated acpi_dsdt_add_sleep_gpe_event_handler(),
on respin
> >
> >> + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0E")));
> >> + Aml *pkg = aml_package(2);
> >> + aml_append(pkg, aml_int(0x01));
> >> + aml_append(pkg, aml_int(0x04));
> >> + aml_append(dev, aml_name_decl("_PRW", pkg));
> >> + aml_append(dev, aml_operation_region("\\Boo", AML_SYSTEM_IO,
> > use some sensible name for opreg
> will do
> >> + aml_int(0x201), 0x1));
> >> + Aml *field = aml_field("\\Boo", AML_BYTE_ACC, AML_NOLOCK,
> >> + AML_WRITE_AS_ZEROS);
> >> + aml_append(field, aml_named_field("SBP", 1));
> >> + aml_append(field, aml_named_field("SBW", 1));
> >> + aml_append(dev, field);
> >> + aml_append(scope, dev);
> >> +}
> > also above and below lacks any documentation,
> > add comments for relevant spec references, like we do with other ACPI
> > functions. Also perhaps, it's out of order, reviewer has not clue
> > where from above registers come and how it is supposed to work.
> >
> > if you invented those registers, there should be a preceding doc patch
> > that documents them.
> >
> > Suggest to reorder after patch that implements above registers in hw,
> > and also comment here where to look for them.
>
> Thanks for the feedback.
>
> Thanks
> Annie
>
> >> +
> >> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope)
> >> +{
> >> + Aml *method = aml_method("_L07", 0, AML_NOTSERIALIZED);
> >> + Aml *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);
> >> + condition = aml_if(aml_name("\\_SB.SLPB.SBW"));
> >> + aml_append(condition, aml_store(aml_int(1), aml_name("\\_SB.SLPB.SBW")));
> >> + aml_append(condition,
> >> + aml_notify(aml_name("\\_SB."ACPI_SLEEP_BUTTON_DEVICE),
> >> + aml_int(0x2)));
> >> + aml_append(method, condition);
> >> + aml_append(scope, method);
> >> +}
> >> diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
> >> index fa5c07db90..0b4f1b432d 100644
> >> --- a/hw/acpi/meson.build
> >> +++ b/hw/acpi/meson.build
> >> @@ -17,6 +17,7 @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
> >> acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c'))
> >> acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.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'))
> >> diff --git a/include/hw/acpi/control_method_device.h b/include/hw/acpi/control_method_device.h
> >> new file mode 100644
> >> index 0000000000..87f8d6fd59
> >> --- /dev/null
> >> +++ b/include/hw/acpi/control_method_device.h
> >> @@ -0,0 +1,25 @@
> >> +/*
> >> + * Control method devices
> >> + *
> >> + * Copyright (c) 2023 Oracle and/or its affiliates.
> >> + *
> >> + *
> >> + * Authors:
> >> + * Annie Li<annie.li@oracle.com>
> >> + *
> >> + *
> >> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> >> + * See the COPYING file in the top-level directory.
> >> + *
> >> + */
> >> +
> >> +
> >> +#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);
> >> +void acpi_dsdt_add_sleep_gpe_event_handler(Aml *scope);
> >> +
> >> +#endif
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2024-10-11 17:32 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 18:38 [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
2024-10-07 12:44 ` Igor Mammedov
2024-10-08 15:21 ` Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Annie Li
2024-10-07 12:59 ` Igor Mammedov
2024-10-08 15:22 ` Annie Li
2024-10-11 12:10 ` Igor Mammedov
2024-09-27 18:38 ` [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes Annie Li
2024-09-27 18:38 ` [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Annie Li
2024-10-07 13:32 ` Igor Mammedov
2024-10-08 15:33 ` Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86 Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 09/11] hw/arm: enable sleep support " Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button Annie Li
2024-09-27 18:39 ` [RFC V2 PATCH 11/11] arm/virt: enable sleep support Annie Li
2024-10-08 11:53 ` Peter Maydell
2024-10-10 12:43 ` Miguel Luis
2024-10-07 13:41 ` [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button Igor Mammedov
2024-10-08 15:21 ` Annie Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).