From patchwork Fri Sep 27 18:38:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D62E7CDD1D2 for ; Fri, 27 Sep 2024 18:41:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFsf-0006FF-0O; Fri, 27 Sep 2024 14:39:53 -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 1suFsa-0006DP-H1; Fri, 27 Sep 2024 14:39:49 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFsY-00023x-NN; Fri, 27 Sep 2024 14:39:48 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMXPK018140; Fri, 27 Sep 2024 18:39:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=6hrdkryTBjvcg1y4G5EzM9NS5I2Qxgtz76wtet5ugaM=; b= cd5SicN9SA0tZwPzP3t+OUOpok16l+0B3dvaqIfRSpnDg9pioxt3QMfDA7b+r/0j 71T/++5298dZgdUbfBsh6os742pCD6l+aCv9kASUNkqjAIapkzfvJqt00QWC8mdn M0uprt6bwhMBBYd27OWEqtsLmnN2PfPiRpFq7uc4gmNc0Pn3opUI7MqDkk5VZLc+ 5hY2TZpme7T7MNQkIQIxR6UCqd47XWXsNbK/6jkipwbE8gSPeAop1HC6JcmQ+Gin qc/HHPqkV8tA6muZPWQe3D81LGKKJIrrKmbReAx3hYg1cRK0Ks80u35CFlKgGkf3 FKkI2byJW3INGpNWJeDKBg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smx3dxkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:28 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHD0xR032835; Fri, 27 Sep 2024 18:39:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8fk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:27 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIoV009004; Fri, 27 Sep 2024 18:39:27 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-2; Fri, 27 Sep 2024 18:39:26 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 01/11] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Date: Fri, 27 Sep 2024 14:38:56 -0400 Message-ID: <20240927183906.1248-2-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: 8b9tLGVeq0zGq9hhQeVcPywBDasH9BZt X-Proofpoint-GUID: 8b9tLGVeq0zGq9hhQeVcPywBDasH9BZt Received-SPF: pass client-ip=205.220.177.32; envelope-from=annie.li@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- 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': [ From patchwork Fri Sep 27 18:38:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F1C0CDD1D2 for ; Fri, 27 Sep 2024 18:41:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFsu-00076R-NR; Fri, 27 Sep 2024 14:40:08 -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 1suFsr-0006we-0A; Fri, 27 Sep 2024 14:40:05 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFso-00024U-Rj; Fri, 27 Sep 2024 14:40:04 -0400 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMavk018461; Fri, 27 Sep 2024 18:39:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=Y2ScNx7uhiDnRyw9+fg5cWmlnPTsA01dpbRI8RLsQyY=; b= QSTmCtlZLvKrPAWlcjMXi61cwKD5Dawmox9VOnaaeUHXZgDtCjKQaqTQBMzCUza8 +a5Wgk7D8oZEK1uT08oIP9GdZfZ2M8KGMa0o2J4CK08CGyJ0+67TlzoYovrmPI/f zhhf10bzFSXRwUGq63lRg+o0ZBCMH+tEZR3fiJChLoq2dWjH/BAarNxYMooO69cE c96pck/9xaxIijMXBpb9G9e4B6XCInHjDUM4W7BAhEsGu3NmC3biB7sgSlKSV5P5 La/t7+up3QPllTWLYQ1N/9Tf6ncV6s78lyBSClxCa3ChJz+42VDvOwMBVpx95wMk rSKXGb1t9bcUzy6COMrW0Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sn2d0jw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:34 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHSZDh032841; Fri, 27 Sep 2024 18:39:33 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8fma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:33 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIoX009004; Fri, 27 Sep 2024 18:39:32 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-3; Fri, 27 Sep 2024 18:39:32 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 02/11] acpi: Implement control method sleep button Date: Fri, 27 Sep 2024 14:38:57 -0400 Message-ID: <20240927183906.1248-3-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-GUID: 0dNhWGXxYG-hmIw3q3XSreHD5bhy5CA9 X-Proofpoint-ORIG-GUID: 0dNhWGXxYG-hmIw3q3XSreHD5bhy5CA9 Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 | 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 + * + * + * 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 + * + * + * 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 From patchwork Fri Sep 27 18:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814492 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34ACDCDD1D3 for ; Fri, 27 Sep 2024 18:41:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFsf-0006Hr-KK; Fri, 27 Sep 2024 14:39:53 -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 1suFsb-0006Dl-HX; Fri, 27 Sep 2024 14:39:49 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFsa-00024c-0e; Fri, 27 Sep 2024 14:39:49 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMZ3v010391; Fri, 27 Sep 2024 18:39:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=ZoS9VTmubQZKW7D17UNywEPYHCq3GI69ubjqd16eJtQ=; b= Mg6mUe5tnrALSEDRqkLSdSqBIAL04cddHk+IyApUHzDNig2AN/3yU85huans4bKg 4/7v+1/r+iNMc0/7nMpeXuZsSxx5Hne2WXBdET1lvCzK6A97dkogJLbgGGEk6fGD Sjf5XHmAiuTsb3iTHqlzIu5GATPnhBtL8Sc6uQ7cDfO95pDDz489eTtrQP5FPRQI /M54sImo+WC/zac4lEvqVDY4uE5s1ESMHx2rM3btrdcrl4PCzLkto6GhCVih5nst 6HuRqXxhGVw+iOiw/eWPRSWJ4c89rjEMF6T5oESigC0N5SUsKis4CcEhuF9ZBWQW SXaHZ90qaod76mOCf2tXUw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smjddrbu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:40 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RGsb36032825; Fri, 27 Sep 2024 18:39:39 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8fnv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:39 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIoZ009004; Fri, 27 Sep 2024 18:39:38 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-4; Fri, 27 Sep 2024 18:39:38 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 03/11] test/acpi: allow DSDT table changes Date: Fri, 27 Sep 2024 14:38:58 -0400 Message-ID: <20240927183906.1248-4-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: WGhNb5z16FuRQ4r8KGkHRbuv9Pb8V7ix X-Proofpoint-GUID: WGhNb5z16FuRQ4r8KGkHRbuv9Pb8V7ix Received-SPF: pass client-ip=205.220.177.32; envelope-from=annie.li@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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-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", From patchwork Fri Sep 27 18:38:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814494 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F68BCDD1D2 for ; Fri, 27 Sep 2024 18:41:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFsm-0006ia-6z; Fri, 27 Sep 2024 14:40:00 -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 1suFsk-0006Zo-0w; Fri, 27 Sep 2024 14:39:58 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFsi-00025G-80; Fri, 27 Sep 2024 14:39:57 -0400 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMchJ018494; Fri, 27 Sep 2024 18:39:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=+vcRWWGd/9tf+6KOZuMJ4EFLau3Zv/DD9us8GvcSK6g=; b= Hn5NzCtqn7iVmey8z5e2ZrWjW2NC+Ye+2by+JMpyRccdkxti7gnTMjFY6k8PtmQV sbDHE/hM1Hz1SlHZ1bpnCGgbd4OEv34QkCST2vvE2ME1ms7iStayMxCi/XCDj4Bj SHE7P7UsuI2/wA9O5VLzvb4+YKarnbOmXFuOgXhJtIhM4osCWdCvJY4xGFIQu8Xw PF2lXLqUpu/asEMT5CC3QZjtglDgHpbCZM7jNCBknsnWURR9DIOmuatatA305eIn wR1DStYoAufKPOPDwGFi1GR3Vn1zByqUkumX2HYUUvxZ7zBDLTdxoA+5fwldun+o 12RKOLyJ54CUW7PEShWoSg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sn2d0jwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:46 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RH5V56032872; Fri, 27 Sep 2024 18:39:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8fqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:45 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIob009004; Fri, 27 Sep 2024 18:39:44 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-5; Fri, 27 Sep 2024 18:39:44 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 04/11] acpi: Support Control Method sleep button for x86 Date: Fri, 27 Sep 2024 14:38:59 -0400 Message-ID: <20240927183906.1248-5-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-GUID: VIkM-io6WJDS8fJ-vzdhJ0hWQo8Yqmh7 X-Proofpoint-ORIG-GUID: VIkM-io6WJDS8fJ-vzdhJ0hWQo8Yqmh7 Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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/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 { From patchwork Fri Sep 27 18:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82F0ACDD1D2 for ; Fri, 27 Sep 2024 18:41:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFss-0006zE-Mo; Fri, 27 Sep 2024 14:40:06 -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 1suFso-0006pT-ST; Fri, 27 Sep 2024 14:40:03 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFsk-00025U-NC; Fri, 27 Sep 2024 14:40:01 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMZFt032210; Fri, 27 Sep 2024 18:39:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=tWvsQ/gKmJg974nVfDan3aoG7E8GrdiSyQqpdRsN2YE=; b= K83QIj71qeXnJt6Tw6rYncLiNG4kF6MNJDUvPguNbL1+e9aSYrMbiVDUuoRfAP4z 6PfXIckk2pZYQYei2baL+Ttsj6/McHRkivKJE2u/M0Tss0AkwD024mWLetLbb/lV D4wp3/S9kHoqkIXQboEtCVqITODfW4hl9VpdO/pMMiy7omiktYOOSj7ZxGu6OU7k +9Xc37LVEIxacrxjgqtnrGainmQS7XrVT4Hk9P2xNGx+iNM7lnpqFb3Hb7OYoFw2 ZO4ZqKWxNAkTSTRDraUKx3I827xlDuahLzuOSUmL5BSwy01XL71UevOIUxOPLtcw +qP1dKvpKM2Q2VCv0/2ryQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1ar9dc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:52 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHD0xW032835; Fri, 27 Sep 2024 18:39:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8fus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:50 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIod009004; Fri, 27 Sep 2024 18:39:50 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-6; Fri, 27 Sep 2024 18:39:49 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 05/11] tests/acpi: Update DSDT tables for Control method sleep button Date: Fri, 27 Sep 2024 14:39:00 -0400 Message-ID: <20240927183906.1248-6-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: cX11ysq7ifehmA_gok2CdHH3SsZ6PK7_ X-Proofpoint-GUID: cX11ysq7ifehmA_gok2CdHH3SsZ6PK7_ Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- 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=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$7BxCD5*}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&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-KCDjc!^aUH z5EL%N%EZXU65SBvl%F5Z$j!*a7~Loc<~RmB1;jH3JB7zH3iz_c#JdN$iny}H`xuxr rEYOS5XNDOFQdYo-CeQ}9&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=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_0NLKCDVsHmV 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=Yi)DB#N$6Yn12D&oo(?_*%j sus|(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|=Yi)DB#N$6Yn12D&oo(?_*%j sus|tFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4 sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-NN#CAml0LfuFA^-pY delta 24 gcmZ2u{>_xjCD5*)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=Yi)DB#N$6Yn12D&oo(?_*%j sus|CDtFvl_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=Yi)DB#N$6Yn12D&oo(?_*%j sus|=Yi)DB#N$6Yn12D&oo(?_*%j sus|5*=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$CDu1FqxnWIcFE1hB`2{10AK=Yi)DB#N$6Yn12D&oo(?_*%j sus|kX*tJ0Olq+4gdfE delta 24 gcmaFmw8fFjCDOV 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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kX*$90OZ~|5&!@I delta 24 gcmez1vdfvvCDjc!^aUH z5EL%N%EZXU65SBvl%F5Z$j!*a7~Loc<~RmB1;jH3JB7zH3iz_c#JdN$iny}H`xuxr sEYOS5XNDOFQdYo-CeQ}9&Q`z?;kCD)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_CDOV 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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kW7>W0M-~d#Q*>R delta 24 fcmZ3U_A!OaCDAdUuxiV5j)#Ci@sY5F^+pz=|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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kWA(T0E{d+SpWb4 delta 24 fcmZ4K_SuEYCDtFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4 sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao+*~04}3BtpET3 delta 24 gcmZ4C`^lTjCD=Yi)DB#N$6Yn12D&oo(?_*%j sus|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=Yi)DB#N$6Yn12D&oo(?_*%j sus|ki5qZ0J*L?3jhEB delta 24 gcmZ4D{LYcfCD`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!*CDtFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4 sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao-dd04@SKumAu6 delta 24 gcmdn!{M(VsCD=Yi)DB#N$6Yn12D&oo(?_*%j sus|kX*tJ0Olq+4gdfE delta 24 gcmaFmw8fFjCDOV 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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kbJ}g0Ht0y_W%F@ delta 24 gcmZ4C`^lTjCD=Yi)DB#N$6Yn12D&oo(?_*%j sus|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=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(aMJCDl78;-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=Yi)DB#N$6Yn12D&oo(?_*%j sus|=Yi)DB#N$6Yn12D&oo(?_*%j sus|keta50MleR>;M1& delta 24 gcmccbw9=8wCD=Yi)DB#N$6Yn12D&oo(?_*%j sus|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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kW7>W0M-~d#Q*>R delta 24 fcmZ3U_A!OaCDAdUuxiV5j)#Ci@sY5F^+pz=|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=Yi)DB#N$6Yn12D&oo(?_*%j sus|kmTk90F8V&1ONa4 delta 24 fcmccUKHH7UCDRksEe 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|JY%p^cs!$kFI!B!dw{EmD_gve ufjPqhy%>FFn1LW=1&n9{ZD0${z&3IS05e^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*CDtFvl_2DIlIP*eN`oQNWiiCf+^3Rm7Do-p9b4 sVS!$ZJ~PZfkg@_sG=Vm-g=SzIxf;;ahoh?xkB6v-C}-L%Ao+qD06fMy!~g&Q delta 24 gcmZ4I{lk;XCDms_(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", From patchwork Fri Sep 27 18:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFB4CCDD1D3 for ; Fri, 27 Sep 2024 18:41:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFsz-0007LZ-CV; Fri, 27 Sep 2024 14:40:13 -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 1suFsw-0007Ez-PZ; Fri, 27 Sep 2024 14:40:10 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFst-0002IB-Mh; Fri, 27 Sep 2024 14:40:10 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMY1E018988; Fri, 27 Sep 2024 18:39:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=WUAIwnS3VoVePc+BcDnyeq7tmpb2t4i1TH6as8Pihzk=; b= KumB2B4JZgLBxH34uPQ6xzyHCdRvK9FkVsUdqerwI7zKdDsSEJOe9Z7ctUCN+2/k 5WuurtYRDV45j7amzOYvSJCXEE4BmI7BDdte8HChO0T8gY02Ockfx/1jpmj6zCGz d+Mwo3S9+eqYavZFujNcd0AvTBI0soUrU+SSnNG8EuS6vVYx9EvapS+QfzKp7cTS yMt8z2vmew+1Xp2NJYVIYNZQsAzGUpdpbyH2kPTwEdPgQ8az+yeG4XoB/LT6Ra2d gx5tFd2ZCZ+NQezflnwn4dQXyL0y8E5qLnDBhvJ3Nwfh3II+7CM2DXqV//7Wphwr NrZzAw9G7k3FBpqZdBGkjA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smr1gh7g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:58 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RIT3eu032853; Fri, 27 Sep 2024 18:39:57 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8g03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:39:57 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIof009004; Fri, 27 Sep 2024 18:39:56 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-7; Fri, 27 Sep 2024 18:39:55 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 06/11] acpi: Send the GPE event of suspend and wakeup for x86 Date: Fri, 27 Sep 2024 14:39:01 -0400 Message-ID: <20240927183906.1248-7-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: 6i4fyM18r8xUOUBqJ7JTKYz2wxw8CX3W X-Proofpoint-GUID: 6i4fyM18r8xUOUBqJ7JTKYz2wxw8CX3W Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 | 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" From patchwork Fri Sep 27 18:39:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68660CDD1D3 for ; Fri, 27 Sep 2024 18:41:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFt6-0007Vo-6U; Fri, 27 Sep 2024 14:40:20 -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 1suFt0-0007QJ-KI; Fri, 27 Sep 2024 14:40:14 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFsy-0002Iu-PL; Fri, 27 Sep 2024 14:40:14 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMYk2003724; Fri, 27 Sep 2024 18:40:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=r1MC4/Y3JJVNOxZK9r+3XatXL0NbxdTuvIqRLdo/CvA=; b= oGiSoNp2ex41bN4Fz3ByTARXdKW1HWRmRG9odW4VVPx7mfwATvUr5HzD0dABflu6 c/cJytzZDvSSVr8Y9xlYvtXHao5pKI/0I9hjNFQsh9ESMb6O14Ixn0vKcCoIOJ9Y 32asseDXywy766Kyp22N+RSYjSnTxyzEnazzvHQeBc+emOw+KEBK3nBWs4+24aeE ah+/S+DwiYh7mMK0cRtWRXNGYxdi3gFqOrE8iFeLjyugDQfx0bVaQcAdNauvoDC7 3S74Iozk9Me0qgc0fBHi7H/5w/7BTDOPRXkbmgQ+h6SWMAD0UJhG7hLpbdOk/Lpr gaTt/g8whxWtJOd1insahg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sppuge27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:05 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RIBHR3032871; Fri, 27 Sep 2024 18:40:03 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8gae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:03 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIoh009004; Fri, 27 Sep 2024 18:40:03 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-8; Fri, 27 Sep 2024 18:40:02 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 07/11] hw/acpi: Add ACPI GED support for the sleep event Date: Fri, 27 Sep 2024 14:39:02 -0400 Message-ID: <20240927183906.1248-8-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-GUID: oq34muK8_Tvzlk6a2yOY0b0aEEU91JZX X-Proofpoint-ORIG-GUID: oq34muK8_Tvzlk6a2yOY0b0aEEU91JZX Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 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; From patchwork Fri Sep 27 18:39:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A42C8CDD1D3 for ; Fri, 27 Sep 2024 18:41:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFtB-0007gO-C5; Fri, 27 Sep 2024 14:40:25 -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 1suFt7-0007ah-DA; Fri, 27 Sep 2024 14:40:21 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFt5-0002Jp-Sp; Fri, 27 Sep 2024 14:40:21 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMbn0032355; Fri, 27 Sep 2024 18:40:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=inndt6ew6MTEcC6kmRfkoTY6qU9U3jastIodPwqdQos=; b= Xa+ZALnN9X4H+25sdnv2cmXax2QbWp+RbHhxnpYDOue8Q7lU8Vx4tb25i0rk0kca swLZn3fv8wBdhukgVcM08xIRixZitRdWB+8BxF00g+YScj/GlTJVKTiQ505Aw6CM zJ3qAeA1GvBZFlcBRJt4AjobrWJLXlNojrSe7eeNyA16GfMmtp8Xbhj/mNUGUkv2 W0CpRYt6cAGYmDtheBvT/fEhkBDgIE/45V6f7EmZYXAtxsRLZjrNSo0+VrtkVWeF zDWqPbWA2bt7UdLvHAfOsxlpQia4Dml9raleROkmbr916edNiR2HsBy7MRTRMTpH Q25aDOmLU6fpIt5LG7zVzA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1ar9e1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:12 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RIA5lt032892; Fri, 27 Sep 2024 18:40:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8gjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:10 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIoj009004; Fri, 27 Sep 2024 18:40:09 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-9; Fri, 27 Sep 2024 18:40:09 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 08/11] tests/acpi: allow FACP and DSDT table changes for arm/virt Date: Fri, 27 Sep 2024 14:39:03 -0400 Message-ID: <20240927183906.1248-9-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: 595fO0j4qbCA8aJwtyAjaqmLQKpJjjjy X-Proofpoint-GUID: 595fO0j4qbCA8aJwtyAjaqmLQKpJjjjy Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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-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", From patchwork Fri Sep 27 18:39:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D854FCDD1D3 for ; Fri, 27 Sep 2024 18:41:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFtR-000842-F6; Fri, 27 Sep 2024 14:40:41 -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 1suFtE-0007qD-1H; Fri, 27 Sep 2024 14:40:29 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFtC-0002KN-8t; Fri, 27 Sep 2024 14:40:27 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMbn2032355; Fri, 27 Sep 2024 18:40:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=mbjiV8400H7bzf4lI60mywWUq/qn6oPHqXerlfqzuaU=; b= fs/766anhsB7deUwEbFakfH9ZUYUwjXpIe1wpv+uflFmesuwm+zM7ur0DTHsiqq/ 2/6gaqMsr0scU0xRvMa16sc3s566vgUMfcadGis0VLLurI9P5p8C2VIINLmWiy7G PTesTPF9WYeeONrPlT24rbGf2FLxGQdXy+E/OwLH8qq5AKKLCI4k3kCInTRiaygh 4FUrjF2MRCjyCJsic6yK3RhKpecCEqyI1o3IIFc81BInwJ99phED8KG0K6BvrO9O +KMGx/zwM30z5yvSbzwJtzWEJmWSF3jYd2oTIl0b7iHE0tvhfSKmgJsqdils14Bf FCrvDrjcTnIzOt7wZmTYmQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1ar9e7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:19 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHkEV3032954; Fri, 27 Sep 2024 18:40:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8gqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:17 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIol009004; Fri, 27 Sep 2024 18:40:17 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-10; Fri, 27 Sep 2024 18:40:16 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 09/11] hw/arm: enable sleep support for arm/virt Date: Fri, 27 Sep 2024 14:39:04 -0400 Message-ID: <20240927183906.1248-10-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: 8bwulBmtk26lQ1F8CScoJaJboc2LWne8 X-Proofpoint-GUID: 8bwulBmtk26lQ1F8CScoJaJboc2LWne8 Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 | 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; From patchwork Fri Sep 27 18:39:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E149ACDD1D2 for ; Fri, 27 Sep 2024 18:42:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFtW-0008Sa-Mz; Fri, 27 Sep 2024 14:40:46 -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 1suFtO-0007x0-5i; Fri, 27 Sep 2024 14:40:39 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFtM-0002Kx-3x; Fri, 27 Sep 2024 14:40:37 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMaeg032276; Fri, 27 Sep 2024 18:40:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=h61Gm34lZnRD9yK0JNtobZVXv9um/pHmr3hWMI6anxQ=; b= iX9kGP2ZGTEhoTOU3oc/YsRvA+ildsCGN57lQOZOn4VbJRpUzOVOuqi1+neJsEv4 pd3xbFVQjh/Tqlr+Rw9rh5qPRC5qO9S4bXjCKHwLKXzoH7zyGI2YqGvKLNA4SY2M /rbTofNuGyuseU86zqBWmjN8TYpYemx++rmFxRjjKVW0GbPNLnHIFbBK2TOWZEqZ joyvan5T6UsxXqCTNHEBROVKn5WgyzPT09fAzAKZL7NX5YEf7bcpyYjbezTz2BMl Pt23Htl9Hp3n7ERJAxWOK4RtgHbQRPsyeLYQj7O/+onIKiBbLpHb6JD87wWNrqwA FC/TAECiBIuFW+VMKvquKg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41sp1ar9ek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:28 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RH67Nd032904; Fri, 27 Sep 2024 18:40:26 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8gvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:26 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIon009004; Fri, 27 Sep 2024 18:40:26 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-11; Fri, 27 Sep 2024 18:40:25 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 10/11] tests/acpi: Update FACP and DSDT tables for sleep button Date: Fri, 27 Sep 2024 14:39:05 -0400 Message-ID: <20240927183906.1248-11-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: 549awtULSwg0gET17eDMHkDPXHh6nYH3 X-Proofpoint-GUID: 549awtULSwg0gET17eDMHkDPXHh6nYH3 Received-SPF: pass client-ip=205.220.165.32; envelope-from=annie.li@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Miguel Luis [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 --- 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;A1rCDXV|0^!j9z@OQ#??>i6h>_(}l(F6JvCvAeiGA>=Y2s80-`t&jV+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+hP^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!`CCDz9tiFqQIG*i!`jq2XAOwJsWOJsu?^(LQ?mEl_;Fu6K`OMrn( zpe@)ZVDdv*ImhTG`xw3WV5fMXfD=c&ho=jV;{_f*j`)C}a3NMEMlP1I`AOw delta 42 ycmaE%HBF1lCDxl;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", From patchwork Fri Sep 27 18:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Annie Li X-Patchwork-Id: 13814490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE388CDD1D5 for ; Fri, 27 Sep 2024 18:41:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suFta-0000Mk-6N; Fri, 27 Sep 2024 14:40:50 -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 1suFtU-0008ML-Nz; Fri, 27 Sep 2024 14:40:45 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suFtS-0002LK-Gp; Fri, 27 Sep 2024 14:40:44 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHMXAn018123; Fri, 27 Sep 2024 18:40:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:mime-version:content-transfer-encoding; s= corp-2023-11-20; bh=Kttuzan+2SEQ2RSLRx2BTKlmBgGkB2zb7Y5AdN50UrQ=; b= B5139c2kceeGsXoYs8l9I2nrU29LuwNYDRorJfDz31OyraMhDBTgTAGugD0V5XPM n65K2YP8xqPMtSdCV6Q/XUdo3M9z4FwHgkcisPZUYXr9Qgat872+EzCxC/XBcepI CrI4F2Onrp602o42Qxe+4/CsoTEWEtXPfa5YMVuOmVPnN4xCPr5dliTFMu8fZDSp evE36nkM3SOtRNoG+QdZ2PbpmGhyK1UFqkT8l1+X4NhxAYLJq1rJ5ulymulFBWgc vCN3mHG9qscnrYDCZi1GPcVhf/bQWHB/1SDXVAc8FxIanOaJJgy/joqvZqPlOPEV 0DD/OMnUTGf+cOvwZHuJhg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smx3dxnq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:35 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RHrdx3032809; Fri, 27 Sep 2024 18:40:34 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkm8h02-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2024 18:40:34 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48RIdIop009004; Fri, 27 Sep 2024 18:40:34 GMT Received: from localhost.localdomain (dhcp-10-175-14-34.vpn.oracle.com [10.175.14.34]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 41smkm8ff6-12; Fri, 27 Sep 2024 18:40:33 +0000 From: Annie Li To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, imammedo@redhat.com Cc: dave@treblig.org, mst@redhat.com, anisinha@redhat.com, shannon.zhaosl@gmail.com, peter.maydell@linaro.org, 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@oracle.com, miguel.luis@oracle.com Subject: [RFC V2 PATCH 11/11] arm/virt: enable sleep support Date: Fri, 27 Sep 2024 14:39:06 -0400 Message-ID: <20240927183906.1248-12-annie.li@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240927183906.1248-1-annie.li@oracle.com> References: <20240927183906.1248-1-annie.li@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270135 X-Proofpoint-ORIG-GUID: aF2CkG-XpRUMGPD827sinozii9Y4rsL_ X-Proofpoint-GUID: aF2CkG-XpRUMGPD827sinozii9Y4rsL_ Received-SPF: pass client-ip=205.220.177.32; envelope-from=annie.li@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: miguel.luis@oracle.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 + 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;