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

Re: [Minios-devel] [UNIKRAFT PATCH v3] plat/common: perform ACPI poweroff on shutdown for x86



Great!

Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 29.03.19, 16:02, "Florian Schmidt" <Florian.Schmidt@xxxxxxxxx> wrote:

    Note that this is hypervisor/emulator-specific and currently only
    supports QEMU (and whoever is compatible with QEMU).
    
    Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
    ---
     plat/common/x86/cpu_native.c | 17 +++++++++++++----
     1 file changed, 13 insertions(+), 4 deletions(-)
    
    diff --git a/plat/common/x86/cpu_native.c b/plat/common/x86/cpu_native.c
    index 57ea3a21..e29c2dbc 100644
    --- a/plat/common/x86/cpu_native.c
    +++ b/plat/common/x86/cpu_native.c
    @@ -51,10 +51,19 @@ unsigned long read_cr2(void)
     void system_off(void)
     {
        /*
    -    * Poke the QEMU "isa-debug-exit" device to "shutdown". Should be
    -    * harmless if it is not present. This is used to enable automated
    -    * tests on virtio.  Note that the actual QEMU exit() status will
    -    * be 83 ('S', 41 << 1 | 1).
    +    * Perform an ACPI shutdown by writing (SLP_TYPa | SLP_EN) to PM1a_CNT.
    +    * Generally speaking, we'd have to jump through a lot of hoops to
    +    * collect those values, however, for QEMU, those are static. Should be
    +    * harmless if we're not running on QEMU, especially considering we're
    +    * already shutting down, so who cares if we crash.
    +    */
    +   outw(0x604, 0x2000);
    +
    +   /*
    +    * If that didn't work for whatever reason, try poking the QEMU
    +    * "isa-debug-exit" device to "shutdown". Should be harmless if it is
    +    * not present. This is used to enable automated tests on virtio.  Note
    +    * that the actual QEMU exit() status will be 83 ('S', 41 << 1 | 1).
         */
        outw(0x501, 41);
     }
    -- 
    2.21.0
    
    

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.