[PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support

liu.xuemei1@zte.com.cn posted 4 patches 2 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Sunil V L <sunilvl@ventanamicro.com>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>
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(+)
[PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
Posted by liu.xuemei1@zte.com.cn 2 weeks, 4 days ago
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
Re: [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
Posted by Anup Patel 2 weeks ago
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
Re: [PATCH v6 RESEND 0/4] hw/riscv/virt: Add acpi ged and powerdown support
Posted by liu.xuemei1@zte.com.cn 2 weeks ago
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