[PULL][mantic/noble:linux-aws] aws: Support hibernation on Graviton

Philip Cox philip.cox at canonical.com
Wed May 8 17:30:24 UTC 2024


SRU Justification:

BugLink: https://bugs.launchpad.net/bugs/2060992


[Impact]
This change contains two parts, the first is adding support for
- KVM and guest support for the PSCI SYSTEM_OFF2 (hibernate) call

And the second part is:
- Guest kernel support for clean boot on demand

For KVM and guest support for the PSCI SYSTEM_OFF2 (hibernate) call:

PSCI v1.3 adds support for SYSTEM_OFF2 which is analogous to ACPI S4 state.

This will allow hosting environments to determine that a guest is
hibernated rather than just powered off, and ensure that they preserve the
virtual environment appropriately to allow the guest to resume safely (or
bump the hardware_signature in the FACS to trigger a clean reboot instead).

For Guest kernel support for clean boot on demand:

The FACS field in the ACPI table is optional, but can be used communicate
the hardware_signature field. If this field changes on resuming from a
hibernation a clean reboot should happen rather than the resume from
hibernation.

On hardware reduced platforms[0] this field may exist but it is not exposed
currently.

[Fix]

The changes for KVM and guest support for the PSCI SYSTEM_OFF2 (hibernate)
call come from:
https://lore.kernel.org/lkml/20240312135958.727765-1-dwmw2@infradead.org

The changes for Guest kernel support for clean boot on demand come from:
https://lore.kernel.org/lkml/20240312134148.727454-1-dwmw2@infradead.org

Latest patches have been picked from:
- noble/mantic:
https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8

- jammy:
https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-5.15

[Test Plan]
AWS test.

[Where problems could occur]
If on hardware reduced platforms that incorrectly support/advertise the
FACS field, hibernation may break if it returns a hardware signature that
changes.

[Other info]
SF# 00383181

[0]: See Section 4.1 of the ACPI spec for info on hardware-reduced
platforms.
https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/04_ACPI_Hardware_Specification/ACPI_Hardware_Specification.html

----------------------------------------------------------------

The changes apply cleanly to mantic and noble


The following changes since commit 9fa50355f6e76412644497bd75e7f958b7d1b640:

UBUNTU: Ubuntu-aws-6.8.0-1003.3 (2024-04-10 18:05:01 +0200)

are available in the Git repository at:

git+ssh://philcox@git.launchpad.net/~philcox/+git/aws-noble
philcox/sf00383181-lp2061006-support-PSCI-SYSTEM_OFF2

for you to fetch changes up to 3dfe0bdca8a4b1556a62e4e27ff1f27b3fd123a7:

UBUNTU: [Config]: Enable hibernate on arm64 (2024-05-08 12:42:40 -0400)

----------------------------------------------------------------
David Woodhouse (8):
UBUNTU: SAUCE: firmware/psci: Add definitions for PSCI v1.3 specification
(ALPHA)
UBUNTU: SAUCE: KVM: arm64: Add PSCI v1.3 SYSTEM_OFF2 function for
hibernation
UBUNTU: SAUCE: KVM: arm64: Add support for PSCI v1.2 and v1.3
UBUNTU: SAUCE: KVM: selftests: Add test for PSCI SYSTEM_OFF2
UBUNTU: SAUCE: KVM: arm64: nvhe: Pass through PSCI v1.3 SYSTEM_OFF2 call
UBUNTU: SAUCE: arm64: Use SYSTEM_OFF2 PSCI call to power off for hibernate
UBUNTU: SAUCE: ACPICA: Detect FACS even for hardware reduced platforms
UBUNTU: SAUCE: arm64: acpi: Honour firmware_signature field of FACS, if it
exists

Philip Cox (1):
UBUNTU: [Config]: Enable hibernate on arm64

Documentation/virt/kvm/api.rst | 11 +++++
arch/arm64/include/uapi/asm/kvm.h | 6 +++
arch/arm64/kernel/acpi.c | 10 ++++
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 2 +
arch/arm64/kvm/hypercalls.c | 2 +
arch/arm64/kvm/psci.c | 43 ++++++++++++++++-
debian.aws/config/annotations | 15 ++++++
drivers/acpi/acpica/tbfadt.c | 30 ++++++------
drivers/acpi/acpica/tbutils.c | 7 +--
drivers/firmware/psci/psci.c | 37 +++++++++++++++
include/kvm/arm_psci.h | 4 +-
include/uapi/linux/psci.h | 20 ++++++++
kernel/power/hibernate.c | 5 +-
tools/testing/selftests/kvm/aarch64/psci_test.c | 61
+++++++++++++++++++++++++
14 files changed, 227 insertions(+), 26 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20240508/cee30bd3/attachment.html>


More information about the kernel-team mailing list