RFC ARM: Implement PSCI SYSTEM_SUSPEND
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | TESTONLY: Sync KVM headers with pending changesinclude/ | +21 | 0 replies | |
| 2/5 | Allow architectures to hook KVM_EXIT_SYSTEM_EVENTinclude/ kvm-cpu.c | +9 | 0 replies | |
| 3/5 | ARM: Stash vcpu_init in the vCPU structurearm/ arm/ | +10 | 0 replies | |
| 4/5 | ARM: Add a helper to re-init a vCPUarm/ | +10 | 0 replies | |
| 5/5 | ARM: Implement PSCI SYSTEM_SUSPENDarm/ arm/ arm/ +2 more | +233 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH kvmtool 0/5] ARM: Implement PSCI SYSTEM_SUSPEND
This is a prototype for supporting KVM_CAP_ARM_SYSTEM_SUSPEND on kvmtool. The capability allows userspace to expose the SYSTEM_SUSPEND PSCI call to its guests.
Implement SYSTEM_SUSPEND using KVM_MP_STATE_SUSPENDED, which emulates the execution of a WFI instruction in the kernel. Resume the guest when a wakeup event is recognized and reset it to the requested entry address and context ID.
Patches 2-4 are small reworks to more easily shoehorn PSCI support into kvmtool.
Patch 5 adds some SMCCC handlers and makes use of them to implement PSCI SYSTEM_SUSPEND. For now, just check the bare-minimum, that all vCPUs besides the caller have stopped. There are also checks that can be made against the requested entry address, but they are at the discretion of the implementation.
Tested with 'echo mem > /sys/power/state' to see that the vCPU is in fact placed in a suspended state for the PSCI call. Hacked the switch statement to fall through to WAKEUP immediately after to verify the vCPU is set up correctly for resume.
It would be nice if kvmtool actually provided a device good for wakeups, since the RTC implementation has omitted any interrupt support.
kernel changes: http://lore.kernel.org/r/[email protected]
Oliver Upton (5):
TESTONLY: Sync KVM headers with pending changes Allow architectures to hook KVM_EXIT_SYSTEM_EVENT
ARM: Stash vcpu_init in the vCPU structure
ARM: Add a helper to re-init a vCPU
ARM: Implement PSCI SYSTEM_SUSPEND
arm/aarch32/kvm-cpu.c | 72 ++++++++++++++++++++ arm/aarch64/kvm-cpu.c | 66 +++++++++++++++++++ arm/include/arm-common/kvm-cpu-arch.h | 23 ++++--- arm/kvm-cpu.c | 95 ++++++++++++++++++++++++++- arm/kvm.c | 9 +++ include/kvm/kvm-cpu.h | 1 + include/linux/kvm.h | 21 ++++++ kvm-cpu.c | 8 +++ 8 files changed, 283 insertions(+), 12 deletions(-)
Signature · 1 line
2.35.1.723.g4982287a31-goog