From nobody Mon Apr 6 15:00:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=zte.com.cn Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773889374811558.024618873134; Wed, 18 Mar 2026 20:02:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w33ek-0004y3-8J; Wed, 18 Mar 2026 23:02:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33ei-0004xq-Fs; Wed, 18 Mar 2026 23:02:40 -0400 Received: from mxct.zte.com.cn ([183.62.165.209]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33eg-00060R-Dw; Wed, 18 Mar 2026 23:02:40 -0400 Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4fbr8l2dq4z4xfxL; Thu, 19 Mar 2026 11:02:31 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 62J32Lug025061; Thu, 19 Mar 2026 11:02:21 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid32; Thu, 19 Mar 2026 11:02:22 +0800 (CST) X-Zmail-TransId: 2afa69bb673e347-1374e X-Mailer: Zmail v1.0 Message-ID: <20260319110222608U-RD-9Y2xW60md7t4V8Dg@zte.com.cn> In-Reply-To: <20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn> References: 20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn Date: Thu, 19 Mar 2026 11:02:22 +0800 (CST) Mime-Version: 1.0 From: To: , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHY2IFJFU0VORCAxLzRdIHRlc3RzL2FjcGk6IHZpcnQ6IGFsbG93IERTRFQgYWNwaSB0YWJsZSBjaGFuZ2Vz?= X-MAIL: mse-fl1.zte.com.cn 62J32Lug025061 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.132 unknown Thu, 19 Mar 2026 11:02:31 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69BB6747.000/4fbr8l2dq4z4xfxL Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=183.62.165.209; envelope-from=liu.xuemei1@zte.com.cn; helo=mxct.zte.com.cn X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1773889379907154100 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Xuemei Liu Signed-off-by: Xuemei Liu --- 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", --=20 2.27.0 From nobody Mon Apr 6 15:00:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=zte.com.cn Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773889512919187.87628389174677; Wed, 18 Mar 2026 20:05:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w33gi-0005XD-QW; Wed, 18 Mar 2026 23:04:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33gg-0005Wc-IU; Wed, 18 Mar 2026 23:04:42 -0400 Received: from mxct.zte.com.cn ([183.62.165.209]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33ge-00068v-Ji; Wed, 18 Mar 2026 23:04:42 -0400 Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4fbrC51r2tz51SXx; Thu, 19 Mar 2026 11:04:33 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl2.zte.com.cn with SMTP id 62J34Rh8046436; Thu, 19 Mar 2026 11:04:27 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Thu, 19 Mar 2026 11:04:28 +0800 (CST) X-Zmail-TransId: 2afc69bb67bc94e-10d58 X-Mailer: Zmail v1.0 Message-ID: <202603191104284054mlaSkkPT2nt3ySzlOKBD@zte.com.cn> In-Reply-To: <20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn> References: 20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn Date: Thu, 19 Mar 2026 11:04:28 +0800 (CST) Mime-Version: 1.0 From: To: , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHY2IFJFU0VORCAyLzRdIGh3L3Jpc2N2L3ZpcnQ6IEFkZCBhY3BpIGdlZCBzdXBwb3J0?= Content-Type: text/plain; charset="utf-8" X-MAIL: mse-fl2.zte.com.cn 62J34Rh8046436 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.133 unknown Thu, 19 Mar 2026 11:04:33 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69BB67C1.000/4fbrC51r2tz51SXx Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=183.62.165.209; envelope-from=liu.xuemei1@zte.com.cn; helo=mxct.zte.com.cn X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, CTE_8BIT_MISMATCH=0.999, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1773889517029154100 Content-Transfer-Encoding: quoted-printable From: Xuemei Liu This patch adds ACPI Generic Event Device (GED) support to the RISC-V virt machine. Co-authored-by: Bj=C3=B6rn T=C3=B6pel Signed-off-by: Xuemei Liu --- 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[] =3D { [VIRT_UART0] =3D { 0x10000000, 0x100 }, [VIRT_VIRTIO] =3D { 0x10001000, 0x1000 }, [VIRT_FW_CFG] =3D { 0x10100000, 0x18 }, + [VIRT_ACPI_GED] =3D { 0x10101000, ACPI_GED_EVT_SEL_LEN }, [VIRT_FLASH] =3D { 0x20000000, 0x4000000 }, [VIRT_IMSIC_M] =3D { 0x24000000, VIRT_IMSIC_MAX_SIZE }, [VIRT_IMSIC_S] =3D { 0x28000000, VIRT_IMSIC_MAX_SIZE }, @@ -1270,6 +1272,22 @@ static inline DeviceState *gpex_pcie_init(MemoryRegi= on *sys_mem, return dev; } +static DeviceState *create_acpi_ged(RISCVVirtState *s, DeviceState *irqchi= p) +{ + DeviceState *dev; + uint32_t event =3D ACPI_GED_PWR_DOWN_EVT; + + dev =3D 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 =3D 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 =3D 9, UART0_IRQ =3D 10, RTC_IRQ =3D 11, VIRTIO_IRQ =3D 1, /* 1 to 8 */ --=20 2.27.0 From nobody Mon Apr 6 15:00:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=zte.com.cn Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773889645237228.46035672769426; Wed, 18 Mar 2026 20:07:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w33iw-0006Z9-MQ; Wed, 18 Mar 2026 23:07:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33it-0006Yr-9A; Wed, 18 Mar 2026 23:06:59 -0400 Received: from mxhk.zte.com.cn ([160.30.148.34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33ir-0008UV-Mu; Wed, 18 Mar 2026 23:06:59 -0400 Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4fbrFn0k3Gz4yjjH; Thu, 19 Mar 2026 11:06:53 +0800 (CST) Received: from xaxapp04.zte.com.cn ([10.99.98.157]) by mse-fl2.zte.com.cn with SMTP id 62J36jAW049012; Thu, 19 Mar 2026 11:06:45 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Thu, 19 Mar 2026 11:06:46 +0800 (CST) X-Zmail-TransId: 2afc69bb6846aca-14ed0 X-Mailer: Zmail v1.0 Message-ID: <20260319110646912lfH-Px_D4YbtX1Q7ZRSXc@zte.com.cn> In-Reply-To: <20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn> References: 20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn Date: Thu, 19 Mar 2026 11:06:46 +0800 (CST) Mime-Version: 1.0 From: To: , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHY2IFJFU0VORCAzLzRdIGh3L3Jpc2N2L3ZpcnQ6IGFkZCBzeXN0ZW1fcG93ZXJkb3duIGhtcCBjb21tYW5kIHN1cHBvcnQ=?= X-MAIL: mse-fl2.zte.com.cn 62J36jAW049012 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.133 unknown Thu, 19 Mar 2026 11:06:53 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69BB684D.000/4fbrFn0k3Gz4yjjH Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=160.30.148.34; envelope-from=liu.xuemei1@zte.com.cn; helo=mxhk.zte.com.cn X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1773889647062154100 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Xuemei Liu 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 Reviewed-by: Ani Sinha --- 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 =3D 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 =3D 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 =3D virt_powerdown_req; + qemu_register_powerdown_notifier(&s->powerdown_notifier); + s->machine_done.notify =3D 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]; --=20 2.27.0 From nobody Mon Apr 6 15:00:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=zte.com.cn Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773889750364247.02186124807076; Wed, 18 Mar 2026 20:09:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w33kh-000778-SA; Wed, 18 Mar 2026 23:08:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33kg-00076h-70; Wed, 18 Mar 2026 23:08:50 -0400 Received: from mxhk.zte.com.cn ([160.30.148.35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w33ke-0000BJ-M8; Wed, 18 Mar 2026 23:08:49 -0400 Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4fbrHw5hpCz8Xs77; Thu, 19 Mar 2026 11:08:44 +0800 (CST) Received: from xaxapp04.zte.com.cn ([10.99.98.157]) by mse-fl2.zte.com.cn with SMTP id 62J38dNW051669; Thu, 19 Mar 2026 11:08:39 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid32; Thu, 19 Mar 2026 11:08:40 +0800 (CST) X-Zmail-TransId: 2afa69bb68b8615-1ea11 X-Mailer: Zmail v1.0 Message-ID: <20260319110840842yQtSz2Z4vbFYNq1lVioQo@zte.com.cn> In-Reply-To: <20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn> References: 20260319110005712RbJuYoQlyLGr39EPL4uH4@zte.com.cn Date: Thu, 19 Mar 2026 11:08:40 +0800 (CST) Mime-Version: 1.0 From: To: , , , , , , , , , Cc: , , Subject: =?UTF-8?B?W1BBVENIIHY2IFJFU0VORCA0LzRdIHRlc3RzL2FjcGk6IEFkZCBhY3BpIGdlZCBhbmQgcG93ZXIgYnV0dG9uIGluIERTRFQgZm9yIFJJU0MtVg==?= X-MAIL: mse-fl2.zte.com.cn 62J38dNW051669 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.133 unknown Thu, 19 Mar 2026 11:08:44 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 69BB68BC.002/4fbrHw5hpCz8Xs77 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=160.30.148.35; envelope-from=liu.xuemei1@zte.com.cn; helo=mxhk.zte.com.cn X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1773889752929158500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Xuemei Liu 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: H= ardware ID + Name (_UID, "GED") // _UID: Unique ID + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Set= tings + { + 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 =3D ESEL /* \_SB_.GED_.ESEL */ + If (((Local0 & 0x02) =3D=3D 0x02)) + { + Notify (PWRB, 0x80) // Status Change + } + } + } + + Device (PWRB) + { + Name (_HID, "PNP0C0C" /* Power Button Device */) // _HID: Har= dware ID + Name (_UID, Zero) // _UID: Unique ID + } } } Signed-off-by: Xuemei Liu --- 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/vi= rt/DSDT index 968e1a15c87bb5753b3a84ddb357e26312767220..90de02e889f0057cbaeadb932ae= 135e2ca8943c9 100644 GIT binary patch delta 170 zcmca4{ZNL>CDCZ$iX(pe?8`W3y)<-uvvB&7e2Rp^PySl`4#Cv$U@H#pN zcp4ZO8Z&UjhXT1k2_VZkC|Hn>i@TGJftit$fq|itA-cge$km;Jhe1F?tS! delta 25 hcmaDTb4i-ZCD 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", --=20 2.27.0