[PATCH 1/2] block: Set the name of BlockBackend if possible

2022-10-27 Thread Annie Li
backend that is defined by '-blockdev' option, so the QEMU returns non NULL vpd page when emulating SCSI device. [1] https://github.com/virtio-win/kvm-guest-drivers-windows/commit/b57548c769ed9f431c34f6449ce432dd077cb02e Signed-off-by: Annie Li --- block/block-backend.c

[PATCH 2/2] iotests: Adjust 186.out to account for 'null' node-name

2022-10-27 Thread Annie Li
A recent enhancement for setting the block backend name fails test 186 due to a 'null' node-name. This is expected; adjust the expected test output accordingly. Signed-off-by: Mark Kanda Signed-off-by: Annie Li --- tests/qemu-iotests/186.out | 36 ++

[PATCH 1/1] pcie: Do not set power state for some hot-plugged devices

2021-12-14 Thread Annie Li
the guest fails to boot. An extra flag(set_power) is added in this patch to indicate if pci_set_power is needed. After the device is powered on(PCI_EXP_SLTCTL_PWR_ON), its power state will be set as normal devices. Fixes: 090b32b8dae6 ("implement slot power control for pcie root ports")

[RFC PATCH 00/11] Support ACPI Control Method Sleep button

2023-12-04 Thread Annie Li
/all/20210920095316.2dd13...@redhat.com/T/#mfe24f89778020deeacfe45083f3eea3cf9f55961 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

[RFC PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep

2023-12-04 Thread Annie Li
Following 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

[RFC PATCH 02/11] acpi: Implement control method sleep button

2023-12-04 Thread Annie Li
The control method sleep button is added, as well as its GPE event handler. Co-Developed-by: Miguel Luis Signed-off-by: Annie Li --- hw/acpi/control_method_device.c | 49 + hw/acpi/meson.build | 1 + include/hw/acpi/control_method_device.h

[RFC PATCH 04/11] acpi: Support Control Method sleep button for x86

2023-12-04 Thread Annie Li
Add Control Method Sleep button and its GPE event handler for x86. Signed-off-by: Annie Li --- 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 80db183b78..75985e1423 100644 --- a/hw/i386/acpi-build.c +++ b/hw

[RFC PATCH 05/11] tests/acpi/bios-tables-test: update DSDT tables for Control Method Sleep button

2023-12-04 Thread Annie Li
// Length ) }) OperationRegion (PRST, SystemIO, 0xAF00, 0x0C) Field (PRST, ByteAcc, NoLock, WriteAsZeros) Signed-off-by: Annie Li --- tests/data/acpi/pc/DSDT | Bin 6830 -> 7012 bytes tests/data/acpi/pc/DSDT.acpiers

[RFC PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86

2023-12-04 Thread Annie Li
The GPE event is triggered to notify the guest to suspend or wakeup itself. This patch removes the previous implementation of QEMU_WAKEUP_REASON_OTHER pretending the resume was caused by power button. Signed-off-by: Annie Li --- hw/acpi/core.c | 17 + hw

[RFC PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt

2023-12-04 Thread Annie Li
From: Miguel Luis List changed files for FACP and DSDT table changes for the arm/virt. Signed-off-by: Miguel Luis --- tests/qtest/bios-tables-test-allowed-diff.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-te

[RFC PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button

2023-12-04 Thread Annie Li
From: Miguel Luis * * ACPI Data Table [FACP] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 4]Signature : "FACP"[Fixed ACPI Description Table (FADT)] [004h 0004 4] Table Length : 0114 [008h 0008

[RFC PATCH 11/11] arm/virt: enable sleep support

2023-12-04 Thread Annie Li
From: Miguel Luis This is for reference that qmp_system_sleep relies on wakeup support delegated by qemu_wakeup_suspend_enabled() hence the need for calling qemu_register_wakeup_support(). Signed-off-by: Miguel Luis --- hw/arm/virt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/v

[RFC PATCH 09/11] hw/arm: enable sleep support for arm/virt

2023-12-04 Thread Annie Li
From: Miguel Luis 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 --- hw/arm/virt-acpi-build.c | 13 + hw/arm/virt.c| 13 - include/hw/arm/virt.h

[RFC PATCH 03/11] test/acpi: allow DSDT table changes

2023-12-04 Thread Annie Li
List various DSDT files allowed to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Annie Li --- 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

[RFC PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event

2023-12-04 Thread Annie Li
From: Miguel Luis 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 --- hw/acpi/generic_event_device.c | 9 + include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 10 inse

Re: [RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button

2024-10-08 Thread Annie Li
On 10/7/2024 9:41 AM, Igor Mammedov wrote: On Fri, 27 Sep 2024 14:38:55 -0400 Annie Li 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

Re: [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep

2024-10-08 Thread Annie Li
On 10/7/2024 8:44 AM, Igor Mammedov wrote: On Fri, 27 Sep 2024 14:38:56 -0400 Annie Li 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 o

Re: [RFC V2 PATCH 02/11] acpi: Implement control method sleep button

2024-10-08 Thread Annie Li
On 10/7/2024 8:59 AM, Igor Mammedov wrote: On Fri, 27 Sep 2024 14:38:57 -0400 Annie Li wrote: The control method sleep button is added, as well as its GPE event handler. Co-developed-by: Miguel Luis Signed-off-by: Annie Li --- hw/acpi/control_method_device.c | 54

Re: [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86

2024-10-08 Thread Annie Li
On 10/7/2024 9:32 AM, Igor Mammedov wrote: On Fri, 27 Sep 2024 14:38:59 -0400 Annie Li wrote: Adding Control Method Sleep button and its GPE event handler for x86. Signed-off-by: Annie Li --- hw/i386/acpi-build.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/i386/acpi

[RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt

2024-09-27 Thread Annie Li
From: Miguel Luis List changed files for FACP and DSDT table changes for the arm/virt. Signed-off-by: Miguel Luis --- 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-tes

[RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes

2024-09-27 Thread Annie Li
Signed-off-by: Annie Li --- 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

[RFC V2 PATCH 00/11] Support ACPI Control Method Sleep button

2024-09-27 Thread Annie Li
/#mfe24f89778020deeacfe45083f3eea3cf9f55961 3) https://lore.kernel.org/all/20231205002143.562-1-annie...@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

[RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button

2024-09-27 Thread Annie Li
From: Miguel Luis [000h 4]Signature : "FACP"[Fixed ACPI Description Table (FADT)] [004h 0004 4] Table Length : 0114 [008h 0008 1] Revision : 06 -[009h 0009 1] Checksum : 12 +[009h 0009 1]

[RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86

2024-09-27 Thread Annie Li
The GPE event is triggered to notify the guest to suppend or wakeup itself. Signed-off-by: Annie Li --- 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

[RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event

2024-09-27 Thread Annie Li
From: Miguel Luis 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 --- hw/acpi/generic_event_device.c | 9 + include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 10 inse

[RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86

2024-09-27 Thread Annie Li
Adding Control Method Sleep button and its GPE event handler for x86. Signed-off-by: Annie Li --- 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

[RFC V2 PATCH 02/11] acpi: Implement control method sleep button

2024-09-27 Thread Annie Li
The control method sleep button is added, as well as its GPE event handler. Co-developed-by: Miguel Luis Signed-off-by: Annie Li --- hw/acpi/control_method_device.c | 54 + hw/acpi/meson.build | 1 + include/hw/acpi/control_method_device.h

[RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button

2024-09-27 Thread Annie Li
Notify (\_SB.SLPB, 0x02) // Device Wake +} +} +} + +Scope (_SB) +{ Signed-off-by: Annie Li --- tests/data/acpi/x86/pc/DSDT | Bin 6830 -> 7012 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 6741 -> 6923 bytes tests/data/acpi/x

[RFC V2 PATCH 11/11] arm/virt: enable sleep support

2024-09-27 Thread Annie Li
From: Miguel Luis 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 --- hw/arm/virt.c | 1

[RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep

2024-09-27 Thread Annie Li
Followng hmp/qmp commands are implemented for pressing virtual sleep button, hmp: system_sleep qmp: { "execute": "system_sleep" } These commands put the guest into suspend or other power states depending on the power settings inside the guest. Signed-off-by: Annie Li

[RFC V2 PATCH 09/11] hw/arm: enable sleep support for arm/virt

2024-09-27 Thread Annie Li
From: Miguel Luis 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 --- hw/arm/virt-acpi-build.c | 13 + hw/arm/virt.c| 13 - include/hw/arm/virt.h

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

2025-04-11 Thread Annie Li
es for ARM -- Changes from V1 Rebase the patch set on qemu 9.1.0-rc4 --- Annie Li (12): acpi: Implement control method sleep button test/acpi: allow DSDT table changes for x86 platform acpi: Support Control Method sleep button for x86 tests/qtest/bios-table-tes

[RFC V3 PATCH 01/13] acpi: Implement control method sleep button

2025-04-11 Thread Annie Li
The fixed hardware sleep button isn't appropriate for hardware reduced platform. This patch implements the control method sleep button in a separate source file so that the button can be added for various platforms. Co-developed-by: Miguel Luis Signed-off-by: Annie Li --- hw

[RFC V3 PATCH 02/13] test/acpi: allow DSDT table changes for x86 platform

2025-04-11 Thread Annie Li
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Annie Li --- tests/qtest/bios-tables-test-allowed-diff.h | 42 + 1 file changed, 42 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test

[RFC V3 PATCH 03/13] acpi: Support Control Method sleep button for x86

2025-04-11 Thread Annie Li
Add Control Method Sleep button and its GPE event handler for x86 platform. The GPE event handler notifies OSPM when the Sleep button event is triggered. Signed-off-by: Annie Li --- hw/i386/acpi-build.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[RFC V3 PATCH 04/13] tests/qtest/bios-table-tests: Update ACPI table binaries for x86

2025-04-11 Thread Annie Li
/ Range Maximum 0x01, // Alignment 0x0C, // Length ) }) OperationRegion (PRST, SystemIO, 0x0CD8, 0x0C) Field (PRST, ByteAcc, NoLock, WriteAsZeros) Signed-off-by: Annie Li --- tests/data/acpi/x86/pc/DSDT

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

2025-04-11 Thread Annie Li
The GPE event is triggered to notify x86 guest to suppend itself. The function acpi_send_sleep_event will also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported. Signed-off-by: Annie Li --- hw/acpi/core.c | 10 ++ include/hw/acpi

[RFC V3 PATCH 06/13] test/acpi: allow DSDT table changes for microvm

2025-04-11 Thread Annie Li
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Annie Li --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index

[RFC V3 PATCH 07/13] microvm: support control method sleep button

2025-04-11 Thread Annie Li
Add the support of control method sleep button and System S3 Sleeping State for microvm. Signed-off-by: Annie Li --- hw/i386/acpi-microvm.c | 11 +++ include/hw/acpi/generic_event_device.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/i386/acpi-microvm.c b

[RFC V3 PATCH 08/13] hw/acpi: Add ACPI GED support for the sleep event

2025-04-11 Thread Annie Li
From: Miguel Luis 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 Signed-off-by: Annie Li --- hw/acpi/generic_event_device.c | 9 + include/hw/acpi/generic_event_device.h | 1

[RFC V3 PATCH 09/13] microvm: enable sleep GED event

2025-04-11 Thread Annie Li
The sleep GED event is enabled for MicroVM. Also, the system suspend is enabled when the GED register is set for sleep. Signed-off-by: Annie Li --- hw/i386/microvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index d0a236c74f

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

2025-04-11 Thread Annie Li
Name (_S5, Package (0x04) // _S5_: S5 System State { 0x05, Zero, Zero, Zero }) } } Signed-off-by: Annie Li --- tests/data/acpi/x86/microvm/DSDT| Bin 365 -> 442 bytes tests/data/acpi/x86/microv

[RFC V3 PATCH 11/13] microvm: suspend the system as requested

2025-04-11 Thread Annie Li
Once the microvm guest requests to go to sleep state and sets the GED register with S3 type, QEMU needs to continue suspending the system. Signed-off-by: Annie Li --- hw/acpi/generic_event_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi

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

2025-04-11 Thread Annie Li
The function qemu_wakeup_suspend_enabled combines the suspend and wakeup together. However, the microvm doesn't support wakeup yet. Suspend is enabled here, but wakeup doesn't actually work for microvm now. Signed-off-by: Annie Li --- hw/i386/microvm.c | 1 + 1 file changed, 1

[RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep

2025-04-11 Thread Annie Li
'*_*' format, it is intended to do so to align to existing 'system_*' commands. Signed-off-by: Annie Li --- hmp-commands.hx| 14 ++ hw/core/machine-hmp-cmds.c | 5 + hw/core/machine-qmp-cmds.c | 11 +++ include/monitor/hmp.h

Re: [RFC V3 PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep

2025-04-14 Thread Annie Li
On 4/14/2025 2:31 AM, Markus Armbruster wrote: Annie Li writes: 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 o

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

2025-04-14 Thread Annie Li
On 4/14/2025 11:18 AM, Alex Bennée wrote: Annie Li writes: The GPE event is triggered to notify x86 guest to suppend itself. The function acpi_send_sleep_event will also trigger GED events on HW-reduced systems where ACPI GED sleep event is supported. Signed-off-by: Annie Li --- hw/acpi