* [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
@ 2026-03-19 3:00 liu.xuemei1
2026-03-19 3:02 ` [PATCH v6 RESEND 1/4] tests/acpi: virt: allow DSDT acpi table changes liu.xuemei1
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-19 3:00 UTC (permalink / raw)
To: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl
Cc: qemu-riscv, qemu-devel, liu.xuemei1
From: Xuemei Liu <liu.xuemei1@zte.com.cn>
Add acpi ged and powerdown support for riscv
Changes in v6:
- Removed unnecessary condition when build ged aml
- Link to v5: https://lore.kernel.org/qemu-devel/20260204182041057hohVHgmaAJborE1DrghXH@zte.com.cn/
Changes in v5:
- Added a new patch to allow DSDT acpi table changes
- Split a new patch to support ACPI GED
- Introduced a condition for calling acpi_send_event
- Link to v4: https://lore.kernel.org/qemu-devel/2025111309270952219AjKpVEnbJXB7fcGTE4g@zte.com.cn/
Changes in v4:
- Added modifies of DSDT blob in another patch
- Link to v3: https://lore.kernel.org/qemu-riscv/20250723113739751COZ5PkRzx6aXEuKzsHhm_@zte.com.cn/
Changes in v3:
- Added missing param to virt_is_acpi_enabled
- Fixed failure of bios-tables-test
- Link to v2: https://lore.kernel.org/qemu-riscv/202506201130099861lTkD839Hh6oko8Jo2W2H@zte.com.cn/
Changes in v2:
- Unwrappered acpi_dsdt_add_ged function
- Modified base address of VIRT_ACPI_GED
- Added conditions for function calls
- Adjusted code formatting
- Link to v1: https://lore.kernel.org/qemu-riscv/202506191556260735QxWC8sxRwFURYEvlD24y@zte.com.cn/
Xuemei Liu (4):
tests/acpi: virt: allow DSDT acpi table changes
hw/riscv/virt: Add acpi ged support
hw/riscv/virt: add system_powerdown hmp command support
tests/acpi: Add acpi ged and power button in DSDT for RISC-V
hw/riscv/Kconfig | 1 +
hw/riscv/virt-acpi-build.c | 8 +++++++
hw/riscv/virt.c | 37 ++++++++++++++++++++++++++++++
include/hw/riscv/virt.h | 4 ++++
tests/data/acpi/riscv64/virt/DSDT | Bin 3538 -> 3681 bytes
5 files changed, 50 insertions(+)
--
2.27.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v6 RESEND 1/4] tests/acpi: virt: allow DSDT acpi table changes
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
@ 2026-03-19 3:02 ` liu.xuemei1
2026-03-19 3:04 ` [PATCH v6 RESEND 2/4] hw/riscv/virt: Add acpi ged support liu.xuemei1
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-19 3:02 UTC (permalink / raw)
To: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl
Cc: qemu-riscv, qemu-devel, liu.xuemei1
From: Xuemei Liu <liu.xuemei1@zte.com.cn>
Signed-off-by: Xuemei Liu <liu.xuemei1@zte.com.cn>
---
tests/qtest/bios-tables-test-allowed-diff.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..8e85fcdee9 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,2 @@
/* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/riscv64/virt/DSDT",
--
2.27.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v6 RESEND 2/4] hw/riscv/virt: Add acpi ged support
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
2026-03-19 3:02 ` [PATCH v6 RESEND 1/4] tests/acpi: virt: allow DSDT acpi table changes liu.xuemei1
@ 2026-03-19 3:04 ` liu.xuemei1
2026-03-19 3:06 ` [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support liu.xuemei1
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-19 3:04 UTC (permalink / raw)
To: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl
Cc: qemu-riscv, qemu-devel, liu.xuemei1
From: Xuemei Liu <liu.xuemei1@zte.com.cn>
This patch adds ACPI Generic Event Device (GED) support to
the RISC-V virt machine.
Co-authored-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Xuemei Liu <liu.xuemei1@zte.com.cn>
---
hw/riscv/Kconfig | 1 +
hw/riscv/virt-acpi-build.c | 6 ++++++
hw/riscv/virt.c | 23 +++++++++++++++++++++++
include/hw/riscv/virt.h | 3 +++
4 files changed, 33 insertions(+)
diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig
index 0222c93f87..3dad43669f 100644
--- a/hw/riscv/Kconfig
+++ b/hw/riscv/Kconfig
@@ -68,6 +68,7 @@ config RISCV_VIRT
select PLATFORM_BUS
select ACPI
select ACPI_PCI
+ select ACPI_HW_REDUCED
config SHAKTI_C
bool
diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
index f1406cb683..1717b1c24f 100644
--- a/hw/riscv/virt-acpi-build.c
+++ b/hw/riscv/virt-acpi-build.c
@@ -27,6 +27,7 @@
#include "hw/acpi/acpi-defs.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
+#include "hw/acpi/generic_event_device.h"
#include "hw/acpi/pci.h"
#include "hw/acpi/utils.h"
#include "hw/intc/riscv_aclint.h"
@@ -498,6 +499,11 @@ static void build_dsdt(GArray *table_data,
acpi_dsdt_add_gpex_host(scope, PCIE_IRQ + VIRT_IRQCHIP_NUM_SOURCES * 2);
}
+ build_ged_aml(scope, "\\_SB."GED_DEVICE,
+ HOTPLUG_HANDLER(s->acpi_ged),
+ ACPI_GED_IRQ, AML_SYSTEM_MEMORY,
+ s->memmap[VIRT_ACPI_GED].base);
+
aml_append(dsdt, scope);
/* copy AML table into ACPI tables blob and patch header there */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index bbce2fb667..4f1654d5ec 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -55,6 +55,7 @@
#include "hw/pci-host/gpex.h"
#include "hw/display/ramfb.h"
#include "hw/acpi/aml-build.h"
+#include "hw/acpi/generic_event_device.h"
#include "qapi/qapi-visit-common.h"
#include "hw/virtio/virtio-iommu.h"
#include "hw/uefi/var-service-api.h"
@@ -95,6 +96,7 @@ static const MemMapEntry virt_memmap[] = {
[VIRT_UART0] = { 0x10000000, 0x100 },
[VIRT_VIRTIO] = { 0x10001000, 0x1000 },
[VIRT_FW_CFG] = { 0x10100000, 0x18 },
+ [VIRT_ACPI_GED] = { 0x10101000, ACPI_GED_EVT_SEL_LEN },
[VIRT_FLASH] = { 0x20000000, 0x4000000 },
[VIRT_IMSIC_M] = { 0x24000000, VIRT_IMSIC_MAX_SIZE },
[VIRT_IMSIC_S] = { 0x28000000, VIRT_IMSIC_MAX_SIZE },
@@ -1270,6 +1272,22 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem,
return dev;
}
+static DeviceState *create_acpi_ged(RISCVVirtState *s, DeviceState *irqchip)
+{
+ DeviceState *dev;
+ uint32_t event = ACPI_GED_PWR_DOWN_EVT;
+
+ dev = qdev_new(TYPE_ACPI_GED);
+ qdev_prop_set_uint32(dev, "ged-event", event);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+
+ sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, s->memmap[VIRT_ACPI_GED].base);
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
+ qdev_get_gpio_in(irqchip, ACPI_GED_IRQ));
+
+ return dev;
+}
+
static FWCfgState *create_fw_cfg(const MachineState *ms, hwaddr base)
{
FWCfgState *fw_cfg;
@@ -1702,6 +1720,11 @@ static void virt_machine_init(MachineState *machine)
create_platform_bus(s, mmio_irqchip);
+ /* acpi ged */
+ if (virt_is_acpi_enabled(s)) {
+ s->acpi_ged = create_acpi_ged(s, mmio_irqchip);
+ }
+
serial_mm_init(system_memory, s->memmap[VIRT_UART0].base,
0, qdev_get_gpio_in(mmio_irqchip, UART0_IRQ), 399193,
serial_hd(0), DEVICE_LITTLE_ENDIAN);
diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
index 18a2a323a3..9ea0b3b7b6 100644
--- a/include/hw/riscv/virt.h
+++ b/include/hw/riscv/virt.h
@@ -47,6 +47,7 @@ struct RISCVVirtState {
/*< public >*/
Notifier machine_done;
+ DeviceState *acpi_ged;
DeviceState *platform_bus_dev;
RISCVHartArrayState soc[VIRT_SOCKETS_MAX];
DeviceState *irqchip[VIRT_SOCKETS_MAX];
@@ -88,9 +89,11 @@ enum {
VIRT_PLATFORM_BUS,
VIRT_PCIE_ECAM,
VIRT_IOMMU_SYS,
+ VIRT_ACPI_GED,
};
enum {
+ ACPI_GED_IRQ = 9,
UART0_IRQ = 10,
RTC_IRQ = 11,
VIRTIO_IRQ = 1, /* 1 to 8 */
--
2.27.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
2026-03-19 3:02 ` [PATCH v6 RESEND 1/4] tests/acpi: virt: allow DSDT acpi table changes liu.xuemei1
2026-03-19 3:04 ` [PATCH v6 RESEND 2/4] hw/riscv/virt: Add acpi ged support liu.xuemei1
@ 2026-03-19 3:06 ` liu.xuemei1
2026-03-19 7:26 ` Ani Sinha
2026-03-19 3:08 ` [PATCH v6 RESEND 4/4] tests/acpi: Add acpi ged and power button in DSDT for RISC-V liu.xuemei1
2026-03-22 15:42 ` [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support Anup Patel
4 siblings, 1 reply; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-19 3:06 UTC (permalink / raw)
To: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl
Cc: qemu-riscv, qemu-devel, liu.xuemei1
From: Xuemei Liu <liu.xuemei1@zte.com.cn>
For riscv virt machine, add powerdown notification callback
and send ACPI_POWER_DOWN_STATUS event by acpi ged. Also add
acpi dsdt table for ACPI_POWER_BUTTON_DEVICE device in this
patch.
Signed-off-by: Xuemei Liu <liu.xuemei1@zte.com.cn>
---
hw/riscv/virt-acpi-build.c | 2 ++
hw/riscv/virt.c | 14 ++++++++++++++
include/hw/riscv/virt.h | 1 +
3 files changed, 17 insertions(+)
diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
index 1717b1c24f..77aea55ece 100644
--- a/hw/riscv/virt-acpi-build.c
+++ b/hw/riscv/virt-acpi-build.c
@@ -504,6 +504,8 @@ static void build_dsdt(GArray *table_data,
ACPI_GED_IRQ, AML_SYSTEM_MEMORY,
s->memmap[VIRT_ACPI_GED].base);
+ acpi_dsdt_add_power_button(scope);
+
aml_append(dsdt, scope);
/* copy AML table into ACPI tables blob and patch header there */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 4f1654d5ec..20002c6e43 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -51,6 +51,7 @@
#include "system/kvm.h"
#include "system/tpm.h"
#include "system/qtest.h"
+#include "system/runstate.h"
#include "hw/pci/pci.h"
#include "hw/pci-host/gpex.h"
#include "hw/display/ramfb.h"
@@ -1446,6 +1447,16 @@ static void virt_build_smbios(RISCVVirtState *s)
}
}
+static void virt_powerdown_req(Notifier *notifier, void *opaque)
+{
+ RISCVVirtState *s;
+
+ s = container_of(notifier, RISCVVirtState, powerdown_notifier);
+ if (s->acpi_ged) {
+ acpi_send_event(s->acpi_ged, ACPI_POWER_DOWN_STATUS);
+ }
+}
+
static void virt_machine_done(Notifier *notifier, void *data)
{
RISCVVirtState *s = container_of(notifier, RISCVVirtState,
@@ -1773,6 +1784,9 @@ static void virt_machine_init(MachineState *machine)
sysbus_realize_and_unref(SYS_BUS_DEVICE(iommu_sys), &error_fatal);
}
+ s->powerdown_notifier.notify = virt_powerdown_req;
+ qemu_register_powerdown_notifier(&s->powerdown_notifier);
+
s->machine_done.notify = virt_machine_done;
qemu_add_machine_init_done_notifier(&s->machine_done);
}
diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
index 9ea0b3b7b6..e631d57268 100644
--- a/include/hw/riscv/virt.h
+++ b/include/hw/riscv/virt.h
@@ -47,6 +47,7 @@ struct RISCVVirtState {
/*< public >*/
Notifier machine_done;
+ Notifier powerdown_notifier;
DeviceState *acpi_ged;
DeviceState *platform_bus_dev;
RISCVHartArrayState soc[VIRT_SOCKETS_MAX];
--
2.27.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v6 RESEND 4/4] tests/acpi: Add acpi ged and power button in DSDT for RISC-V
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
` (2 preceding siblings ...)
2026-03-19 3:06 ` [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support liu.xuemei1
@ 2026-03-19 3:08 ` liu.xuemei1
2026-03-22 15:42 ` [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support Anup Patel
4 siblings, 0 replies; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-19 3:08 UTC (permalink / raw)
To: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl
Cc: qemu-riscv, qemu-devel, liu.xuemei1
From: Xuemei Liu <liu.xuemei1@zte.com.cn>
Update the reference DSDT blob to include acpi ged and power button
for RISC-V.
DSDT diff:
* Original Table Header:
* Signature "DSDT"
- * Length 0x00000DD2 (3538)
+ * Length 0x00000E61 (3681)
* Revision 0x02
- * Checksum 0x25
+ * Checksum 0xFC
* OEM ID "BOCHS "
* OEM Table ID "BXPC "
* OEM Revision 0x00000001 (1)
@@ -1463,6 +1463,39 @@ DefinitionBlock ("", "DSDT", 2, "BOCHS ", "BXPC ", 0x00000001)
})
}
}
+
+ Device (\_SB.GED)
+ {
+ Name (_HID, "ACPI0013" /* Generic Event Device */) // _HID: Hardware ID
+ Name (_UID, "GED") // _UID: Unique ID
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
+ {
+ 0x00000009,
+ }
+ })
+ OperationRegion (EREG, SystemMemory, 0x10101000, 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
+ }
+ }
+ }
+
+ Device (PWRB)
+ {
+ Name (_HID, "PNP0C0C" /* Power Button Device */) // _HID: Hardware ID
+ Name (_UID, Zero) // _UID: Unique ID
+ }
}
}
Signed-off-by: Xuemei Liu <liu.xuemei1@zte.com.cn>
---
tests/data/acpi/riscv64/virt/DSDT | Bin 3538 -> 3681 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 1 -
2 files changed, 1 deletion(-)
diff --git a/tests/data/acpi/riscv64/virt/DSDT b/tests/data/acpi/riscv64/virt/DSDT
index 968e1a15c87bb5753b3a84ddb357e26312767220..90de02e889f0057cbaeadb932ae135e2ca8943c9 100644
GIT binary patch
delta 170
zcmca4{ZNL>CD<h-k&l6a>CZ$iX(pe?8`W3y)<-uvvB&7e2Rp^PySl`4#Cv$U@H#pN
zcp4ZO8Z&UjhXT1k2_VZkC|Hn>i@TGJftit$fq|itA-cge$km;Jhe1F<fQu!%ksHKy
zb`5s*Q4o=hcMS{SEC6v576?qPPT*o<;9_bE2oG}NYKU%<1TjFC3ApeE_yrg^8#qHO
GV*mhK>?tS!
delta 25
hcmaDTb4i-ZCD<k85-$S-lj=k+X(r!W8`W3y0sv*P2bll>
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 8e85fcdee9..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,2 +1 @@
/* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/riscv64/virt/DSDT",
--
2.27.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support
2026-03-19 3:06 ` [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support liu.xuemei1
@ 2026-03-19 7:26 ` Ani Sinha
0 siblings, 0 replies; 8+ messages in thread
From: Ani Sinha @ 2026-03-19 7:26 UTC (permalink / raw)
To: liu.xuemei1
Cc: Michael Tsirkin, Igor Mammedov, Paolo Bonzini, palmer,
Alistair Francis, liwei1518, dbarboza, zhiwei_liu, sunilvl,
qemu-riscv, qemu-devel
> On 19 Mar 2026, at 8:36 AM, liu.xuemei1@zte.com.cn wrote:
>
> From: Xuemei Liu <liu.xuemei1@zte.com.cn>
>
> For riscv virt machine, add powerdown notification callback
> and send ACPI_POWER_DOWN_STATUS event by acpi ged. Also add
> acpi dsdt table for ACPI_POWER_BUTTON_DEVICE device in this
> patch.
>
> Signed-off-by: Xuemei Liu <liu.xuemei1@zte.com.cn>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
> ---
> hw/riscv/virt-acpi-build.c | 2 ++
> hw/riscv/virt.c | 14 ++++++++++++++
> include/hw/riscv/virt.h | 1 +
> 3 files changed, 17 insertions(+)
>
> diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> index 1717b1c24f..77aea55ece 100644
> --- a/hw/riscv/virt-acpi-build.c
> +++ b/hw/riscv/virt-acpi-build.c
> @@ -504,6 +504,8 @@ static void build_dsdt(GArray *table_data,
> ACPI_GED_IRQ, AML_SYSTEM_MEMORY,
> s->memmap[VIRT_ACPI_GED].base);
>
> + acpi_dsdt_add_power_button(scope);
> +
> aml_append(dsdt, scope);
>
> /* copy AML table into ACPI tables blob and patch header there */
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 4f1654d5ec..20002c6e43 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -51,6 +51,7 @@
> #include "system/kvm.h"
> #include "system/tpm.h"
> #include "system/qtest.h"
> +#include "system/runstate.h"
> #include "hw/pci/pci.h"
> #include "hw/pci-host/gpex.h"
> #include "hw/display/ramfb.h"
> @@ -1446,6 +1447,16 @@ static void virt_build_smbios(RISCVVirtState *s)
> }
> }
>
> +static void virt_powerdown_req(Notifier *notifier, void *opaque)
> +{
> + RISCVVirtState *s;
> +
> + s = container_of(notifier, RISCVVirtState, powerdown_notifier);
> + if (s->acpi_ged) {
> + acpi_send_event(s->acpi_ged, ACPI_POWER_DOWN_STATUS);
> + }
> +}
> +
> static void virt_machine_done(Notifier *notifier, void *data)
> {
> RISCVVirtState *s = container_of(notifier, RISCVVirtState,
> @@ -1773,6 +1784,9 @@ static void virt_machine_init(MachineState *machine)
> sysbus_realize_and_unref(SYS_BUS_DEVICE(iommu_sys), &error_fatal);
> }
>
> + s->powerdown_notifier.notify = virt_powerdown_req;
> + qemu_register_powerdown_notifier(&s->powerdown_notifier);
> +
> s->machine_done.notify = virt_machine_done;
> qemu_add_machine_init_done_notifier(&s->machine_done);
> }
> diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> index 9ea0b3b7b6..e631d57268 100644
> --- a/include/hw/riscv/virt.h
> +++ b/include/hw/riscv/virt.h
> @@ -47,6 +47,7 @@ struct RISCVVirtState {
>
> /*< public >*/
> Notifier machine_done;
> + Notifier powerdown_notifier;
> DeviceState *acpi_ged;
> DeviceState *platform_bus_dev;
> RISCVHartArrayState soc[VIRT_SOCKETS_MAX];
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
` (3 preceding siblings ...)
2026-03-19 3:08 ` [PATCH v6 RESEND 4/4] tests/acpi: Add acpi ged and power button in DSDT for RISC-V liu.xuemei1
@ 2026-03-22 15:42 ` Anup Patel
2026-03-23 1:34 ` liu.xuemei1
4 siblings, 1 reply; 8+ messages in thread
From: Anup Patel @ 2026-03-22 15:42 UTC (permalink / raw)
To: liu.xuemei1
Cc: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl, qemu-riscv, qemu-devel
Hi
On Thu, Mar 19, 2026 at 8:30 AM <liu.xuemei1@zte.com.cn> wrote:
>
> From: Xuemei Liu <liu.xuemei1@zte.com.cn>
>
> Add acpi ged and powerdown support for riscv
>
> Changes in v6:
> - Removed unnecessary condition when build ged aml
> - Link to v5: https://lore.kernel.org/qemu-devel/20260204182041057hohVHgmaAJborE1DrghXH@zte.com.cn/
>
> Changes in v5:
> - Added a new patch to allow DSDT acpi table changes
> - Split a new patch to support ACPI GED
> - Introduced a condition for calling acpi_send_event
> - Link to v4: https://lore.kernel.org/qemu-devel/2025111309270952219AjKpVEnbJXB7fcGTE4g@zte.com.cn/
>
> Changes in v4:
> - Added modifies of DSDT blob in another patch
> - Link to v3: https://lore.kernel.org/qemu-riscv/20250723113739751COZ5PkRzx6aXEuKzsHhm_@zte.com.cn/
>
> Changes in v3:
> - Added missing param to virt_is_acpi_enabled
> - Fixed failure of bios-tables-test
> - Link to v2: https://lore.kernel.org/qemu-riscv/202506201130099861lTkD839Hh6oko8Jo2W2H@zte.com.cn/
>
> Changes in v2:
> - Unwrappered acpi_dsdt_add_ged function
> - Modified base address of VIRT_ACPI_GED
> - Added conditions for function calls
> - Adjusted code formatting
> - Link to v1: https://lore.kernel.org/qemu-riscv/202506191556260735QxWC8sxRwFURYEvlD24y@zte.com.cn/
>
> Xuemei Liu (4):
> tests/acpi: virt: allow DSDT acpi table changes
> hw/riscv/virt: Add acpi ged support
> hw/riscv/virt: add system_powerdown hmp command support
> tests/acpi: Add acpi ged and power button in DSDT for RISC-V
>
> hw/riscv/Kconfig | 1 +
> hw/riscv/virt-acpi-build.c | 8 +++++++
> hw/riscv/virt.c | 37 ++++++++++++++++++++++++++++++
> include/hw/riscv/virt.h | 4 ++++
> tests/data/acpi/riscv64/virt/DSDT | Bin 3538 -> 3681 bytes
> 5 files changed, 50 insertions(+)
>
The problem with supporting system_powerdown HPM command
using ARM-style VIRT_ACPI_GED MMIO device is that it only
works with ACPI and does not work with DeviceTree.
We have the system_powerdown HPM command support working
for both DeviceTree and ACPI using RPMI SystemMSI service group.
The corresponding OpenSBI and Linux drivers for RPMI SystemMSI
service group are already available upstream. Only QEMU RPMI
support is pending to be upstreamed.
The RPMI v1.0 (ratified) specification defines System MSI service
groups using which QEMU can send system events as MSIs. These
system events include poweroff request, reboot request, CPU hotplug
events and much more.
For QEMU RPMI implementation using libRPMI, refer to
the dev-upstream branch at https://github.com/ventanamicro/qemu.git
Regards,
Anup
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
2026-03-22 15:42 ` [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support Anup Patel
@ 2026-03-23 1:34 ` liu.xuemei1
0 siblings, 0 replies; 8+ messages in thread
From: liu.xuemei1 @ 2026-03-23 1:34 UTC (permalink / raw)
To: anup
Cc: mst, imammedo, anisinha, pbonzini, palmer, alistair.francis,
liwei1518, dbarboza, zhiwei_liu, sunilvl, qemu-riscv, qemu-devel
Hi Anup,
On Thu, Mar 19, 2026 at 8:30 AM <liu.xuemei1@zte.com.cn> wrote:
>>
>> From: Xuemei Liu <liu.xuemei1@zte.com.cn>
>>
>> Add acpi ged and powerdown support for riscv
>>
>> Changes in v6:
>> - Removed unnecessary condition when build ged aml
>> - Link to v5: https://lore.kernel.org/qemu-devel/20260204182041057hohVHgmaAJborE1DrghXH@zte.com.cn/
>>
>> Changes in v5:
>> - Added a new patch to allow DSDT acpi table changes
>> - Split a new patch to support ACPI GED
>> - Introduced a condition for calling acpi_send_event
>> - Link to v4: https://lore.kernel.org/qemu-devel/2025111309270952219AjKpVEnbJXB7fcGTE4g@zte.com.cn/
>>
>> Changes in v4:
>> - Added modifies of DSDT blob in another patch
>> - Link to v3: https://lore.kernel.org/qemu-riscv/20250723113739751COZ5PkRzx6aXEuKzsHhm_@zte.com.cn/
>>
>> Changes in v3:
>> - Added missing param to virt_is_acpi_enabled
>> - Fixed failure of bios-tables-test
>> - Link to v2: https://lore.kernel.org/qemu-riscv/202506201130099861lTkD839Hh6oko8Jo2W2H@zte.com.cn/
>>
>> Changes in v2:
>> - Unwrappered acpi_dsdt_add_ged function
>> - Modified base address of VIRT_ACPI_GED
>> - Added conditions for function calls
>> - Adjusted code formatting
>> - Link to v1: https://lore.kernel.org/qemu-riscv/202506191556260735QxWC8sxRwFURYEvlD24y@zte.com.cn/
>>
>> Xuemei Liu (4):
>> tests/acpi: virt: allow DSDT acpi table changes
>> hw/riscv/virt: Add acpi ged support
>> hw/riscv/virt: add system_powerdown hmp command support
>> tests/acpi: Add acpi ged and power button in DSDT for RISC-V
>>
>> hw/riscv/Kconfig | 1 +
>> hw/riscv/virt-acpi-build.c | 8 +++++++
>> hw/riscv/virt.c | 37 ++++++++++++++++++++++++++++++
>> include/hw/riscv/virt.h | 4 ++++
>> tests/data/acpi/riscv64/virt/DSDT | Bin 3538 -> 3681 bytes
>> 5 files changed, 50 insertions(+)
>>
>
>The problem with supporting system_powerdown HPM command
>using ARM-style VIRT_ACPI_GED MMIO device is that it only
>works with ACPI and does not work with DeviceTree.
>
>We have the system_powerdown HPM command support working
>for both DeviceTree and ACPI using RPMI SystemMSI service group.
>The corresponding OpenSBI and Linux drivers for RPMI SystemMSI
>service group are already available upstream. Only QEMU RPMI
>support is pending to be upstreamed.
>
>The RPMI v1.0 (ratified) specification defines System MSI service
>groups using which QEMU can send system events as MSIs. These
>system events include poweroff request, reboot request, CPU hotplug
>events and much more.
>
>For QEMU RPMI implementation using libRPMI, refer to
>the dev-upstream branch at https://github.com/ventanamicro/qemu.git
>
>Regards,
>Anup
Thank you very much for the detailed and insightful explanation.
Best regards,
Jessica
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-23 1:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 3:00 [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support liu.xuemei1
2026-03-19 3:02 ` [PATCH v6 RESEND 1/4] tests/acpi: virt: allow DSDT acpi table changes liu.xuemei1
2026-03-19 3:04 ` [PATCH v6 RESEND 2/4] hw/riscv/virt: Add acpi ged support liu.xuemei1
2026-03-19 3:06 ` [PATCH v6 RESEND 3/4] hw/riscv/virt: add system_powerdown hmp command support liu.xuemei1
2026-03-19 7:26 ` Ani Sinha
2026-03-19 3:08 ` [PATCH v6 RESEND 4/4] tests/acpi: Add acpi ged and power button in DSDT for RISC-V liu.xuemei1
2026-03-22 15:42 ` [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support Anup Patel
2026-03-23 1:34 ` liu.xuemei1
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox