Hi Sudeep, Thanks for looking into it.
From: Sudeep Holla sudeep.holla@arm.com Sent: Thursday, July 27, 2023 11:34 AM
On Thu, Jul 27, 2023 at 10:06:58AM +0000, Salil Mehta wrote:
Hello, We have been trying to verify the "system suspend/Restore" with vCPU Hotplug patches recently and found this functionality does not work on ARM64 with VMs even without our patches i.e. using latest kernel and qemu repository.
estuary:/$ cat /sys/power/mem_sleep [s2idle] estuary:/$ estuary:/$ cat /sys/power/state freeze mem disk estuary:/$ estuary:/$ estuary:/$ echo mem > /sys/power/state [ 60.458445] PM: suspend entry (s2idle) [ 60.458840] Filesystems sync: 0.000 seconds [ 60.459649] Freezing user space processes [ 60.461149] Freezing user space processes completed (elapsed 0.001 seconds) [ 60.461830] OOM killer disabled. [ 60.462144] Freezing remaining freezable tasks [ 60.463188] Freezing remaining freezable tasks completed (elapsed 0.000 seconds) [ 60.463920] printk: Suspending console(s) (use no_console_suspend to debug) (qemu) (qemu) sys system_powerdown system_reset system_wakeup (qemu) system_wakeup Error: wake-up from suspend is not supported by this guest (qemu)
Or using # systemctl suspend
What is the expected behavior or are we missing something?
What is the wakeup source in this experiment ? Is it enabled ? You must have done that before executing "echo mem > /sys/power/state". It is tested to generate the interrupt ?
Hmm. I would have thought the keyboard etc. should contribute to those interrupts by default (isn't it?) or do we need to explicitly configure the devices for their interrupts to be use in wakeup from s2idle?
Typically I use RTC on systems as I need not physical access to the platform to test that. $echo +20 > /sys/class/rtc/rtc0/wakealarm $ echo mem > /sys/power/state
This might not work as after putting the VM into s2idle state VM kind of hangs and becomes unresponsive. I would assume that keyboard interrupts are not being considered for waking-up the VM here either.
I can see RTC is configured by Qemu/VMM during init.
Not sure if RTC is available on your system/VM. You just need to find a working wakeup source for your experiment.
Sorry if you have already tried that and seeing issues. You may have just missed to list it here. Thought I will check. The timer are also disabled during any system level sleeps and hence can't wake up without a valid working wakeup source unlike the normal CPU sleep/idle states.
So something like "system_wakeup" from qemu prompt seems to be the way but It looks this is not enabled in Qemu due to missing ACPI handling. Need to dig this further.
Also make sure all the drivers have working suspend resume routines, sometimes the driver resume fails and if the console is not yet resumed at that point, you get no logs.
Good point. This could be a possibility.
Thanks Salil.