~philcox/+git/aws-mantic:philcox/sf00383181-lp2061006-support-PSCI-SYSTEM_OFF2

Last commit made on 2024-05-08
Get this branch:
git clone -b philcox/sf00383181-lp2061006-support-PSCI-SYSTEM_OFF2 https://git.launchpad.net/~philcox/+git/aws-mantic
Only Philip Cox can upload to this branch. If you are Philip Cox please log in for upload directions.

Branch merges

Branch information

Name:
philcox/sf00383181-lp2061006-support-PSCI-SYSTEM_OFF2
Repository:
lp:~philcox/+git/aws-mantic

Recent commits

2313758... by Philip Cox

UBUNTU: [Config]: Enable hibernate on arm64

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

Signed-off-by: Philip Cox <email address hidden>

befb7ec... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: arm64: acpi: Honour firmware_signature field of FACS, if it exists

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

If the firmware_signature changes then OSPM should not attempt to resume
from hibernate, but should instead perform a clean reboot. Set the global
swsusp_hardware_signature to allow the generic code to include the value
in the swsusp header on disk, and perform the appropriate check on resume.

Signed-off-by: David Woodhouse <email address hidden>
Acked-by: Sudeep Holla <email address hidden>
Acked-by: Rafael J. Wysocki <email address hidden>
(cherry picked from commit e527af168e34b5a0465979c6ece3cdb5bddae4a2 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

1fcaa3a... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: ACPICA: Detect FACS even for hardware reduced platforms

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

ACPICA commit 44fc328a1a14b097d92b8be83989e4bf69b6e6cb

The FACS is optional even on hardware reduced platforms, and may exist
for the purpose of communicating the hardware_signature field to provoke
a clean reboot instead of a resume from hibernation.

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit 1241f91583da82c550cbc7d0118322daef714421 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

56ba0c0... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: arm64: Use SYSTEM_OFF2 PSCI call to power off for hibernate

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

The PSCI v1.3 specification (alpha) adds support for a SYSTEM_OFF2
function 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 handle that state appropriately on subsequent launches.

Since commit 60c0d45a7f7a ("efi/arm64: use UEFI for system reset and
poweroff") the EFI shutdown method is deliberately preferred over PSCI
or other methods. So register a SYS_OFF_MODE_POWER_OFF handler which
*only* handles the hibernation, leaving the original PSCI SYSTEM_OFF as
a last resort via the legacy pm_power_off function pointer.

The hibernation code already exports a system_entering_hibernation()
function which is be used by the higher-priority handler to check for
hibernation. That existing function just returns the value of a static
boolean variable from hibernate.c, which was previously only set in the
hibernation_platform_enter() code path. Set the same flag in the simpler
code path around the call to kernel_power_off() too.

An alternative way to hook SYSTEM_OFF2 into the hibernation code would
be to register a platform_hibernation_ops structure with an ->enter()
method which makes the new SYSTEM_OFF2 call. But that would have the
unwanted side-effect of making hibernation take a completely different
code path in hibernation_platform_enter(), invoking a lot of special dpm
callbacks.

Another option might be to add a new SYS_OFF_MODE_HIBERNATE mode, with
fallback to SYS_OFF_MODE_POWER_OFF. Or to use the sys_off_data to
indicate whether the power off is for hibernation.

But this version works and is relatively simple.

Signed-off-by: David Woodhouse <email address hidden>
Acked-by: Rafael J. Wysocki <email address hidden>
(cherry picked from commit 636e8c1b6cb4d7536662de3f79c230d18393a05d from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

0afe424... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: KVM: arm64: nvhe: Pass through PSCI v1.3 SYSTEM_OFF2 call

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

Pass through the SYSTEM_OFF2 function for hibernation, just like SYSTEM_OFF.

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit 8fa239fcdd740a74ec1020f0e713dc3e4e910ecc from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

4307845... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: KVM: selftests: Add test for PSCI SYSTEM_OFF2

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

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit 89a43ab867d59d204221b1d96d62ce88d4d47bf7 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

32736c1... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: KVM: arm64: Add support for PSCI v1.2 and v1.3

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

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit aa04769eb2d1dac50176fe71da3e0df05f6afef6 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

9d8b45f... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: KVM: arm64: Add PSCI v1.3 SYSTEM_OFF2 function for hibernation

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

The PSCI v1.3 specification (alpha) adds support for a SYSTEM_OFF2 function
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).

The beta version will be changed to say that PSCI_FEATURES returns a bit
mask of the supported hibernate types, which is implemented here.

Although this new feature is inflicted unconditionally on unexpecting
userspace, it ought to be mostly OK because it still results in the same
KVM_SYSTEM_EVENT_SHUTDOWN event, just with a new flag which hopefully
won't cause userspace to get unhappy.

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit 3cad88da46c6f1f08a45aaa2201e8b2dcfda3875 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

92c355d... by David Woodhouse <email address hidden>

UBUNTU: SAUCE: firmware/psci: Add definitions for PSCI v1.3 specification (ALPHA)

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

The v1.3 PSCI spec (https://developer.arm.com/documentation/den0022) adds
SYSTEM_OFF2, CLEAN_INV_MEMREGION and CLEAN_INV_MEMREGION_ATTRIBUTES
functions. Add definitions for them and their parameters, along with the
new TIMEOUT, RATE_LIMITED and BUSY error values.

Signed-off-by: David Woodhouse <email address hidden>
(cherry picked from commit fd38a4568c6021068d16d27c5413b1faeb4c31f7 from https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/psci-hibernate-6.8)
Signed-off-by: Philip Cox <email address hidden>

c17b548... by Philip Cox

UBUNTU: Ubuntu-aws-6.5.0-1018.18

Signed-off-by: Philip Cox <email address hidden>