]> www.infradead.org Git - users/dwmw2/linux.git/commit
PM: hibernate: Allow ACPI hardware signature to be honoured
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 8 Nov 2021 16:09:41 +0000 (16:09 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 27 Apr 2024 09:32:08 +0000 (09:32 +0000)
commit9bb5343dc480ac00683d8d8e982cbef124ec32a3
tree4b85223c9b09a3f131aebb6afa5c41ae49bc2fd8
parentc52b9710c83d3b8ab63bb217cc7c8b61e13f12cd
PM: hibernate: Allow ACPI hardware signature to be honoured

Theoretically, when the hardware signature in FACS changes, the OS
is supposed to gracefully decline to attempt to resume from S4:

 "If the signature has changed, OSPM will not restore the system
  context and can boot from scratch"

In practice, Windows doesn't do this and many laptop vendors do allow
the signature to change especially when docking/undocking, so it would
be a bad idea to simply comply with the specification by default in the
general case.

However, there are use cases where we do want the compliant behaviour
and we know it's safe. Specifically, when resuming virtual machines where
we know the hypervisor has changed sufficiently that resume will fail.
We really want to be able to *tell* the guest kernel not to try, so it
boots cleanly and doesn't just crash. This patch provides a way to opt
in to the spec-compliant behaviour on the command line.

A follow-up patch may do this automatically for certain "known good"
machines based on a DMI match, or perhaps just for all hypervisor
guests since there's no good reason a hypervisor would change the
hardware_signature that it exposes to guests *unless* it wants them
to obey the ACPI specification.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 74d9555580c48a04b2c3b742dfb0c80777aa0b26)
Documentation/admin-guide/kernel-parameters.txt
arch/x86/kernel/acpi/sleep.c
drivers/acpi/sleep.c
include/linux/acpi.h
include/linux/suspend.h
kernel/power/power.h
kernel/power/swap.c