qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Annie Li <annie.li@oracle.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, dave@treblig.org, mst@redhat.com,
	anisinha@redhat.com, eduardo@habkost.net,
	marcel.apfelbaum@gmail.com, philmd@linaro.org,
	wangyanan55@huawei.com, zhao1.liu@intel.com, pbonzini@redhat.com,
	richard.henderson@linaro.org, slp@redhat.com, eblake@redhat.com,
	armbru@redhat.com, miguel.luis@oracle.com
Subject: Re: [PATCH 05/13] acpi: Send the GPE event of sleep for x86
Date: Tue, 3 Jun 2025 15:21:15 -0400	[thread overview]
Message-ID: <0712f9be-cd98-4e57-963b-6e6f2ab30b44@oracle.com> (raw)
In-Reply-To: <20250603143431.1ba917df@imammedo.users.ipa.redhat.com>

Hi Igor,

On 6/3/2025 8:34 AM, Igor Mammedov wrote:
> On Wed, 28 May 2025 12:39:52 -0400
> Annie Li <annie.li@oracle.com> wrote:
>
>> The GPE event is triggered to notify x86 guest to sleep
>> itself. The function acpi_send_sleep_event will also
>> trigger GED events on HW-reduced systems where ACPI GED
>> sleep event is supported.
>>
>> Signed-off-by: Annie Li <annie.li@oracle.com>
>> ---
>>   hw/acpi/core.c                       | 12 ++++++++++++
>>   include/hw/acpi/acpi.h               |  1 +
>>   include/hw/acpi/acpi_dev_interface.h |  1 +
>>   3 files changed, 14 insertions(+)
>>
>> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
>> index 58f8964e13..dcabe881bf 100644
>> --- a/hw/acpi/core.c
>> +++ b/hw/acpi/core.c
>> @@ -359,6 +359,18 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)
>>       return -1;
>>   }
>>   
>> +void acpi_send_sleep_event(void)
>> +{
>> +    bool ambiguous;
>> +    Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, &ambiguous);
>> +
>> +    assert(!ambiguous);
>> +    if (obj) {
> Can it ever be NULL?
> If not drop condition.

assert happens earlier if it is NULL.

will drop it.

Thanks

Annie

>
>> +        /* Send sleep 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);
>> diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
>> index d1a4fa2af8..64d3ff78ed 100644
>> --- a/include/hw/acpi/acpi.h
>> +++ b/include/hw/acpi/acpi.h
>> @@ -184,6 +184,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_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"


  reply	other threads:[~2025-06-03 19:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 16:35 [PATCH 00/13] Support ACPI Control Method Sleep button Annie Li
2025-05-28 16:38 ` [PATCH 01/13] acpi: Implement control method sleep button Annie Li
2025-06-03 12:31   ` Igor Mammedov
2025-06-03 19:08     ` Annie Li
2025-08-11 11:58       ` Igor Mammedov
2025-05-28 16:38 ` [PATCH 02/13] test/acpi: allow DSDT table changes for x86 platform Annie Li
2025-05-28 16:39 ` [PATCH 03/13] acpi: Support Control Method sleep button for x86 Annie Li
2025-06-03 12:52   ` Igor Mammedov
2025-06-03 19:19     ` Annie Li
2025-05-28 16:39 ` [PATCH 04/13] tests/qtest/bios-table-tests: Update ACPI table binaries " Annie Li
2025-05-28 16:39 ` [PATCH 05/13] acpi: Send the GPE event of sleep " Annie Li
2025-06-03 12:34   ` Igor Mammedov
2025-06-03 19:21     ` Annie Li [this message]
2025-05-28 16:40 ` [PATCH 06/13] test/acpi: allow DSDT table changes for microvm Annie Li
2025-05-28 16:40 ` [PATCH 07/13] microvm: Add ACPI Control Method Sleep Button Annie Li
2025-05-28 16:40 ` [PATCH 08/13] hw/acpi: Add ACPI GED support for the sleep event Annie Li
2025-05-28 16:41 ` [PATCH 09/13] microvm: enable sleep GED event Annie Li
2025-05-28 16:41 ` [PATCH 10/13] tests/qtest/bios-table-tests: Update ACPI table binaries for microvm Annie Li
2025-05-28 16:41 ` [PATCH 11/13] microvm: suspend the system as requested Annie Li
2025-05-28 16:42 ` [PATCH 12/13] microvm: enable suspend Annie Li
2025-06-03 13:03   ` Igor Mammedov
2025-06-03 19:22     ` Annie Li
2025-08-11 12:06       ` Igor Mammedov
2025-05-28 16:42 ` [PATCH 13/13] acpi: hmp/qmp: Add hmp/qmp support for system_sleep Annie Li
2025-06-02  9:32   ` Markus Armbruster
2025-06-02 14:22     ` Annie Li
2025-06-03 12:18 ` [PATCH 00/13] Support ACPI Control Method Sleep button Igor Mammedov
2025-06-03 19:23   ` Annie Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0712f9be-cd98-4e57-963b-6e6f2ab30b44@oracle.com \
    --to=annie.li@oracle.com \
    --cc=anisinha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=miguel.luis@oracle.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=slp@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).