qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/13] microvm: add isa-acpi device


From: Igor Mammedov
Subject: Re: [PATCH 03/13] microvm: add isa-acpi device
Date: Fri, 20 Mar 2020 15:54:33 +0100

On Fri, 20 Mar 2020 09:22:58 +0100
Gerd Hoffmann <address@hidden> wrote:

> On Thu, Mar 19, 2020 at 02:42:18PM +0100, Igor Mammedov wrote:
> > On Thu, 19 Mar 2020 09:01:07 +0100
> > Gerd Hoffmann <address@hidden> wrote:
> >   
> > > Minimal ACPI device for PCI-less machines like microvm.  
> > it seems that x86 kernel is able to boot on hw-reduced acpi systems
> > (but I haven't really tested any distro kernel, not sure how usable NEMU is)
> > 
> > Maybe reusing hw/acpi/generic_event_device.c (which was borrowed
> > for NEMU effort) would be better since guest won't have to initialize
> > not necessary interfaces and QEMU could implement simpler hw impl
> > compared to full ACPI with GPEs, SCIs & co.  
> 
> I see the generic event device has support for powerdown request events,
> good.  But I'm wondering how entering S5 state (aka poweroff) would
> work then?


Relevant parts from spec:
ACPI6.1:
16.1.7 Transitioning from the Working to the Soft Off State
...
4.
or writes the HW-reduced ACPI Sleep Type value for S5 and the SLP_EN bit to the
Sleep Control Register.

4.8.3.7 Sleep Control and Status Registers

in kernel handled by acpi_hw_extended_sleep()


>From QEMU:

build_fadt_rev5()
  build_fadt()
    ...
    /* SLEEP_CONTROL_REG */
    build_append_gas(tbl, AML_AS_SYSTEM_MEMORY, 0 , 0, 0, 0);
    /* SLEEP_STATUS_REG */
    build_append_gas(tbl, AML_AS_SYSTEM_MEMORY, 0 , 0, 0, 0);
    ...
    this is what board should implement (we cloud add an optional MMIO register 
to
    GED to hanlde shutdown on QEMU side)
    (ARM doesn't use it as it's using arch specific, PSCI method to shutdown 
machine),
    I'd add relevant fields to AcpiFadtData, fill it in build_fadt_rev5() and 
use them in build_fadt()


virt_powerdown_req()
  acpi_send_event(s->acpi_dev, ACPI_POWER_DOWN_STATUS)

triggers in guest AML generated by:

acpi_dsdt_add_power_button()

build_ged_aml()
  ...ACPI_POWER_BUTTON_DEVICE... -> tells OSPM to do 16.1.7 using 4.8.3.7




> 
> cheers,
>   Gerd
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]