[PATCH 0/3] Disable Suspend-to-Idle in Hyper-V and Fix Hibernation Interruptions

Erni Sri Satya Vennela posted 3 patches 2 months, 2 weeks ago
There is a newer version of this series
drivers/hid/hid-hyperv.c              |  6 ------
drivers/hv/vmbus_drv.c                | 15 ++++++++++++++-
drivers/input/serio/hyperv-keyboard.c | 12 ------------
3 files changed, 14 insertions(+), 19 deletions(-)
[PATCH 0/3] Disable Suspend-to-Idle in Hyper-V and Fix Hibernation Interruptions
Posted by Erni Sri Satya Vennela 2 months, 2 weeks ago
It has been reported that Hyper-V VM users can unintentionally abort
hibernation by mouse or keyboard movements. To address this issue,
we have decided to remove the wakeup events for the Hyper-V keyboard
and mouse driver. However, this change introduces another problem: 
Suspend-to-Idle brings the system down with no method to wake it back up.

Given that there are no real users of Suspend-to-Idle in Hyper-V,
we have decided to disable this feature for VMBus. This results in:

$echo freeze > /sys/power/state
> bash: echo: write error: Operation not supported

The keyboard and mouse were previously registered as wakeup sources to
interrupt the freeze operation in a VM. Since the freeze operation itself
is no longer supported, we are disabling them as wakeup events.

This patchset ensures that the system remains stable and prevents
unintended interruptions during hibernation.

Erni Sri Satya Vennela (3):
  Drivers: hv: vmbus: Disable Suspend-to-Idle for VMBus
  Revert "Input: hyperv-keyboard - register as a wakeup source"
  Revert "HID: hyperv: register as a wakeup source"

 drivers/hid/hid-hyperv.c              |  6 ------
 drivers/hv/vmbus_drv.c                | 15 ++++++++++++++-
 drivers/input/serio/hyperv-keyboard.c | 12 ------------
 3 files changed, 14 insertions(+), 19 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] Disable Suspend-to-Idle in Hyper-V and Fix Hibernation Interruptions
Posted by Srivatsa S. Bhat 2 months ago
Hi Vennela,

[+linux-pm, Rafael, Pavel, Len]

Let's CC the linux-pm mailing list for discussions related to power
management features (such as suspend/resume and hibernation).

On Thu, Sep 12, 2024 at 02:27:47PM -0700, Erni Sri Satya Vennela wrote:
> It has been reported that Hyper-V VM users can unintentionally abort
> hibernation by mouse or keyboard movements. To address this issue,
> we have decided to remove the wakeup events for the Hyper-V keyboard
> and mouse driver.

From the description of the problem, it doesn't occur to me that this
is specific to Hyper-V. I was wondering if VMs on other hypervisor
platforms wouldn't face the same issue? I'd like to recommend
exploring how this problem has been solved for other platforms, so
that we can reuse the same approach here. (If it turns out that
removing keyboard and mouse wakeup events is the way to go, then
great; otherwise, we can learn and apply the recommended solution).

> However, this change introduces another problem: 
> Suspend-to-Idle brings the system down with no method to wake it back up.
> 
> Given that there are no real users of Suspend-to-Idle in Hyper-V,
> we have decided to disable this feature for VMBus. This results in:
> 
> $echo freeze > /sys/power/state
> > bash: echo: write error: Operation not supported
> 
> The keyboard and mouse were previously registered as wakeup sources to
> interrupt the freeze operation in a VM. Since the freeze operation itself
> is no longer supported, we are disabling them as wakeup events.
> 
> This patchset ensures that the system remains stable and prevents
> unintended interruptions during hibernation.
> 
> Erni Sri Satya Vennela (3):
>   Drivers: hv: vmbus: Disable Suspend-to-Idle for VMBus
>   Revert "Input: hyperv-keyboard - register as a wakeup source"
>   Revert "HID: hyperv: register as a wakeup source"
> 
>  drivers/hid/hid-hyperv.c              |  6 ------
>  drivers/hv/vmbus_drv.c                | 15 ++++++++++++++-
>  drivers/input/serio/hyperv-keyboard.c | 12 ------------
>  3 files changed, 14 insertions(+), 19 deletions(-)
> 
> -- 
> 2.34.1
> 
> 

Regards,
Srivatsa
Microsoft Linux Systems Group
Re: [PATCH 0/3] Disable Suspend-to-Idle in Hyper-V and Fix Hibernation Interruptions
Posted by Erni Sri Satya Vennela 2 months ago
On Tue, Sep 24, 2024 at 03:26:14AM +0000, Srivatsa S. Bhat wrote:
> Hi Vennela,
> 
> [+linux-pm, Rafael, Pavel, Len]
> 
> Let's CC the linux-pm mailing list for discussions related to power
> management features (such as suspend/resume and hibernation).
> 
> On Thu, Sep 12, 2024 at 02:27:47PM -0700, Erni Sri Satya Vennela wrote:
> > It has been reported that Hyper-V VM users can unintentionally abort
> > hibernation by mouse or keyboard movements. To address this issue,
> > we have decided to remove the wakeup events for the Hyper-V keyboard
> > and mouse driver.
> 
> >From the description of the problem, it doesn't occur to me that this
> is specific to Hyper-V. I was wondering if VMs on other hypervisor
> platforms wouldn't face the same issue? I'd like to recommend
> exploring how this problem has been solved for other platforms, so
> that we can reuse the same approach here. (If it turns out that
> removing keyboard and mouse wakeup events is the way to go, then
> great; otherwise, we can learn and apply the recommended solution).
> 
This is how the keyboard and mouse devices can be disabled manually and
is the proper way to address this issue.
>echo disabled > /sys/bus/vmbus/drivers/hid_hyperv/$HV_MOUSE/power/wakeup
>echo disabled > 
>/sys/bus/vmbus/drivers/hyperv_keyboard/$HV_KEYBOARD/power/wakeup
>systemctl hibernate
But based on customer feedback we are totally eliminating them as wakeup
events.

Initially, they were registered as wakeup events to wakeup from
Suspend-to-Idle state. Since there is no real user of this operation,
we are disabling them to ensure they do not interfere with hibernation
process.
> > However, this change introduces another problem: 
> > Suspend-to-Idle brings the system down with no method to wake it back up.
> > 
> > Given that there are no real users of Suspend-to-Idle in Hyper-V,
> > we have decided to disable this feature for VMBus. This results in:
> > 
> > $echo freeze > /sys/power/state
> > > bash: echo: write error: Operation not supported
> > 
> > The keyboard and mouse were previously registered as wakeup sources to
> > interrupt the freeze operation in a VM. Since the freeze operation itself
> > is no longer supported, we are disabling them as wakeup events.
> > 
> > This patchset ensures that the system remains stable and prevents
> > unintended interruptions during hibernation.
> > 
> > Erni Sri Satya Vennela (3):
> >   Drivers: hv: vmbus: Disable Suspend-to-Idle for VMBus
> >   Revert "Input: hyperv-keyboard - register as a wakeup source"
> >   Revert "HID: hyperv: register as a wakeup source"
> > 
> >  drivers/hid/hid-hyperv.c              |  6 ------
> >  drivers/hv/vmbus_drv.c                | 15 ++++++++++++++-
> >  drivers/input/serio/hyperv-keyboard.c | 12 ------------
> >  3 files changed, 14 insertions(+), 19 deletions(-)
> > 
> > -- 
> > 2.34.1
> > 
> > 
> 
> Regards,
> Srivatsa
> Microsoft Linux Systems Group