[RFC V3 PATCH 09/13] microvm: enable sleep GED event

Annie Li posted 13 patches 8 months, 1 week ago
[RFC V3 PATCH 09/13] microvm: enable sleep GED event
Posted by Annie Li 8 months, 1 week ago
The sleep GED event is enabled for MicroVM. Also, the system
suspend is enabled when the GED register is set for sleep.

Signed-off-by: Annie Li <annie.li@oracle.com>
---
 hw/i386/microvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index d0a236c74f..eba33c4365 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -205,7 +205,8 @@ static void microvm_devices_init(MicrovmMachineState *mms)
     /* Optional and legacy devices */
     if (x86_machine_is_acpi_enabled(x86ms)) {
         DeviceState *dev = qdev_new(TYPE_ACPI_GED);
-        qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT);
+        qdev_prop_set_uint32(dev, "ged-event",
+                             ACPI_GED_PWR_DOWN_EVT | ACPI_GED_SLEEP_EVT);
         sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
         sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE);
         /* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */
-- 
2.43.5
Re: [RFC V3 PATCH 09/13] microvm: enable sleep GED event
Posted by Gustavo Romero 8 months ago
Hi Annie,

On 4/11/25 17:43, Annie Li wrote:
> The sleep GED event is enabled for MicroVM. Also, the system
> suspend is enabled when the GED register is set for sleep.

nit: in the commit messages, please stick with a single case
for microvm (or MicroVM, etc).


> Signed-off-by: Annie Li <annie.li@oracle.com>
> ---
>   hw/i386/microvm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index d0a236c74f..eba33c4365 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -205,7 +205,8 @@ static void microvm_devices_init(MicrovmMachineState *mms)
>       /* Optional and legacy devices */
>       if (x86_machine_is_acpi_enabled(x86ms)) {
>           DeviceState *dev = qdev_new(TYPE_ACPI_GED);
> -        qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT);
> +        qdev_prop_set_uint32(dev, "ged-event",
> +                             ACPI_GED_PWR_DOWN_EVT | ACPI_GED_SLEEP_EVT);
>           sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
>           sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE);
>           /* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>


Cheers,
Gustavo
Re: [RFC V3 PATCH 09/13] microvm: enable sleep GED event
Posted by Annie Li 8 months ago
Hi Gustavo,

On 4/17/2025 1:35 PM, Gustavo Romero wrote:
> Hi Annie,
>
> On 4/11/25 17:43, Annie Li wrote:
>> The sleep GED event is enabled for MicroVM. Also, the system
>> suspend is enabled when the GED register is set for sleep.
>
> nit: in the commit messages, please stick with a single case
> for microvm (or MicroVM, etc).

Will fix this.
Thanks for the review.

Annie

>
>
>> Signed-off-by: Annie Li <annie.li@oracle.com>
>> ---
>>   hw/i386/microvm.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
>> index d0a236c74f..eba33c4365 100644
>> --- a/hw/i386/microvm.c
>> +++ b/hw/i386/microvm.c
>> @@ -205,7 +205,8 @@ static void 
>> microvm_devices_init(MicrovmMachineState *mms)
>>       /* Optional and legacy devices */
>>       if (x86_machine_is_acpi_enabled(x86ms)) {
>>           DeviceState *dev = qdev_new(TYPE_ACPI_GED);
>> -        qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT);
>> +        qdev_prop_set_uint32(dev, "ged-event",
>> +                             ACPI_GED_PWR_DOWN_EVT | 
>> ACPI_GED_SLEEP_EVT);
>>           sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
>>           sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE);
>>           /* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, 
>> GED_MMIO_BASE_MEMHP); */
>
> Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
>
>
> Cheers,
> Gustavo