PM: hibernate: Honour ACPI hardware signature by default for virtual guests

The ACPI specification says that OSPM should refuse to restore from
hibernate if the hardware signature changes, and should boot from
scratch. However, real BIOSes often vary the hardware signature in cases
where we *do* want to resume from hibernate, so Linux doesn't follow the
spec by default.

However, in a virtual environment there's no reason for the VMM to vary
the hardware signature *unless* it wants to trigger a clean reboot as
defined by the ACPI spec. So enable the check by default if a hypervisor
is detected.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
David Woodhouse
2022-03-11 19:20:17 +00:00
committed by Rafael J. Wysocki
parent a759de6991
commit f6c46b1d62
3 changed files with 25 additions and 11 deletions

View File

@@ -526,7 +526,7 @@ acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
int acpi_resources_are_enforced(void);
#ifdef CONFIG_HIBERNATION
void __init acpi_check_s4_hw_signature(int check);
extern int acpi_check_s4_hw_signature;
#endif
#ifdef CONFIG_PM_SLEEP