linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add PSCI v1.3 SYSTEM_OFF2 support for hibernation
@ 2024-03-12 13:51 David Woodhouse
  2024-03-12 13:51 ` [RFC PATCH 1/2] KVM: arm64: Add PSCI SYSTEM_OFF2 function " David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: David Woodhouse @ 2024-03-12 13:51 UTC (permalink / raw)
  To: linux-arm-kernel, kvm
  Cc: Paolo Bonzini, Jonathan Corbet, Marc Zyngier, Oliver Upton,
	James Morse, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Mark Rutland, Lorenzo Pieralisi, Rafael J. Wysocki,
	Len Brown, Pavel Machek, David Woodhouse, Mostafa Saleh,
	Jean-Philippe Brucker, linux-doc, linux-kernel, kvmarm, linux-pm

The upcoming PSCI v1.3 specification 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).

This adds support for it to KVM, and to the guest hibernate code.

Strictly, we should perhaps also allow the guest to detect PSCI v1.3, 
but when v1.1 was added in commit 512865d83fd9 it was done 
unconditionally, which seems wrong. Shouldn't we have a way for 
userspace to control what gets exposed, rather than silently changing 
the guest behaviour with newer host kernels? Should I add a 
KVM_CAP_ARM_PSCI_VERSION?

For the guest side, this adds a new SYS_OFF_MODE_POWER_OFF with higher 
priority than the EFI one, but which *only* triggers when there's a 
hibernation in progress. That seemed like the simplest option, but see 
the commit message for alternative possilities. I told Rafael I'd post a 
straw man for bikeshedding, and here it is.

 Documentation/virt/kvm/api.rst       | 11 +++++++++++
 arch/arm64/include/asm/kvm_host.h    |  2 ++
 arch/arm64/include/uapi/asm/kvm.h    |  6 ++++++
 arch/arm64/kvm/arm.c                 |  5 +++++
 arch/arm64/kvm/hyp/nvhe/psci-relay.c |  2 ++
 arch/arm64/kvm/psci.c                | 37 ++++++++++++++++++++++++++++++++++++
 drivers/firmware/psci/psci.c         | 35 ++++++++++++++++++++++++++++++++++
 include/uapi/linux/kvm.h             |  1 +
 include/uapi/linux/psci.h            |  5 +++++
 kernel/power/hibernate.c             |  5 ++++-
 10 files changed, 108 insertions(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-03-14 11:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 13:51 [RFC PATCH 0/2] Add PSCI v1.3 SYSTEM_OFF2 support for hibernation David Woodhouse
2024-03-12 13:51 ` [RFC PATCH 1/2] KVM: arm64: Add PSCI SYSTEM_OFF2 function " David Woodhouse
2024-03-12 15:36   ` Marc Zyngier
2024-03-12 17:06     ` David Woodhouse
2024-03-12 15:47   ` Oliver Upton
2024-03-13 12:53     ` David Woodhouse
2024-03-13 19:42       ` Oliver Upton
2024-03-13 23:01         ` David Woodhouse
2024-03-12 13:51 ` [RFC PATCH 2/2] arm64: Use SYSTEM_OFF2 PSCI call to power off for hibernate David Woodhouse
2024-03-12 15:57   ` Sudeep Holla
2024-03-12 16:36     ` David Woodhouse
2024-03-13 15:34       ` Sudeep Holla
2024-03-14 11:09         ` Sudeep Holla
2024-03-14 11:27           ` David Woodhouse
2024-03-12 15:24 ` [RFC PATCH 0/2] Add PSCI v1.3 SYSTEM_OFF2 support for hibernation Marc Zyngier
2024-03-12 17:01   ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).