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

[Xen-devel] Powerdown problem on XEN | ACPI S5

Hi guys,
I have been liasing with Ian Campbell on the xen-user list and Ian suggested I should take this to xen-devel.

The issue I am currently facing is as follows:
I seem to be unable to powerdown my system under the XEN hypervisor by issuing the command

        shutdown -h now

from my gentoo-hardened 3.9.5 dom0 machine. Instead of turning off power, it goes through a BIOS power-on sequence and reboots. There's no other domU running at the time of the attempted powerdown.

If I do the same using *exactly the same dom0 kernel* without XEN involved (i.e. boot from my gentoo-hardened 3.9.5 kernel only), powerdown reliably works as expected and 'shutdown -h now' turns off the system's power.

I have tested both 4.2.2 (the gentoo e-build) and 4.3 (downloaded directly from xenbits). There's no difference between those two versions in terms of reboot versus powerdown.

Upon advise from Ian I have also experimented with the various reboot= options on the command line - also with no success.

Adding a serial console (also thanks to Ian's input) I was able to examine the messages during shutdown. I have attached those from 4.2.2 for your reference.

For the latest test using Xen 4.2.2 I made a few changes to the source file xen/arch/x86/acpi/power.c to see where the actual problem may be hidden. I'm far from being a kernel or XEN programmer, but I am able to read and basically understand and (to an extent) modify C code. Supported by finding and identifying the messages I had on the serial console I decided to add a few additional printk statements after the last message that was displayed on the console to see where the system probably crashes / the problems could possibly start:

After my change, the relevant code snippet now looks as follows (NOTE: The printk messages starting with "After" or "Before" stem from me, the first one and the one within the if-construct are both unchanged; the initial one was originally always displayed on the serial console as the final line):

    printk("Entering ACPI S%d state.\n", state);

    printk("After local_irq_save\n");

    printk("After spin_debug_disable\n");

    if ( (error = device_power_down()) )
        printk(XENLOG_ERR "Some devices failed to power down.");
        system_state = SYS_STATE_resume;
        goto done;

    printk("Before ACPI_FLUSH_CPU_CACHE\n");
    printk("After ACPI_FLUSH_CPU_CACHE\n");

The final few messages of the *new* output *after my amateur mods* on the serial console now read as follows:
(XEN) Entering ACPI S5 state.
(XEN) After local_irq_save
(XEN) After spin_debug_disable

There is neither a message reading
(XEN) Some devices failed to power down.
(NOTE: this printk statement however has a XENLOG_ERR before the text - so I am not sure whether that should actually appear on the serial console at all)

nor one reading

This to me seems to indicate, that the problematic code is somewhere in
between the following lines:
    if ( (error = device_power_down()) )
        printk(XENLOG_ERR "Some devices failed to power down.");
        system_state = SYS_STATE_resume;
        goto done;

I hope that might provide you with some insight which, with your help, could be used to make a step forward.

On the other hand I might be completely on the wrong track as I have no clue where the actual requested power-down (or as is: reboot) actually happens. That was not obvious for me from the code in power.c without further knowledge ...

Many thanks in advance for suggestions.

Attachment: XEN console
Description: Text document

Xen-devel mailing list



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