Skip to content

Enable guest suspend/resume support on ARM via vPSCI

Mykola Kvach xen-devel 14 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v17 Latest4 patches 5 repliesIn review
  2. v164 patches 10 repliesSuperseded
  3. v154 patches 5 repliesSuperseded
Earlier versions · 11
VersionPostedPatchesRepliesStatus
v144 patches8 repliesSuperseded
v134 patches8 repliesSuperseded
v124 patches9 repliesSuperseded
v114 patches6 repliesSuperseded
v104 patches3 repliesSuperseded
v94 patches11 repliesSuperseded
v84 patches2 repliesSuperseded
v74 patches4 repliesSuperseded
v64 patches3 repliesSuperseded
v54 patches14 repliesSuperseded
v44 patches11 repliesSuperseded

Changes in v17 from the cover letter

- PSCI SYSTEM_SUSPEND is no longer advertised to the hardware domain via PSCI_FEATURES.
- Split arch_set_info_guest() into separate validate/apply helpers while keeping full PSR validation on the public path.
- Build and validate the PSCI vCPU context during SYSTEM_SUSPEND and store it in resume_ctx.
- Make resume use only the prevalidated context and free it afterward; add resume_ctx_reset() and cleanup in arch_domain_destroy().
- Make arch_domain_resume() void and drop the error path from domain_resume().

Patches in v17 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen/arm: Implement PSCI SYSTEM_SUSPEND call for guestsxen/arch/arm/domain.c xen/arch/arm/include/asm/domain.h xen/arch/arm/include/asm/perfc_defn.h +6 more+258 -425 replies
2/4tools/xl: Allow compilation of 'xl resume' command on Armtools/include/libxl.h tools/xl/xl.h tools/xl/xl_cmdtable.c +3 more+12 -130 replies
3/4SUPPORT.md: Document PSCI SYSTEM_SUSPEND support for guestsSUPPORT.md+3 -20 replies
4/4CHANGELOG: Document guest suspend/resume to RAM support on ArmCHANGELOG.md+4 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAnthony PERARDJulien GrallOleksii KurochkoMichal Orzel
1/4R-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v17 thread

Cover letter [PATCH v17 0/4] Enable guest suspend/resume support on ARM via vPSCI

From: Mykola Kvach <[email protected]>

This patch series introduces the initial support for guest suspend and resume on ARM platforms using the PSCI SYSTEM_SUSPEND interface. The main goal is to allow ARM guests to request suspension using PSCI and be resumed by the control domain (e.g., via "xl resume").

Background

The PSCI SYSTEM_SUSPEND call is part of the PSCI v1.0+ specification and is used by guests to enter the deepest possible power state. On Xen/ARM, we emulate this interface in the virtual PSCI (vPSCI) layer for guests.

This series includes:

1. A new vPSCI implementation of the PSCI SYSTEM_SUSPEND function for guests
2. Documentation updates to SUPPORT.md to reflect PSCI and vPSCI support status
3. Enabling "xl resume" command compilation for ARM, which was previously disabled

Usage

For Linux-based guests:
- Suspend can be triggered using: "echo mem > /sys/power/state" or "systemctl suspend"
- Resume can be performed from control domain using: "xl resume <domain>"

For more information, refer to the official Linux kernel documentation on power management.

Note that currently, SYSTEM_SUSPEND is supported only for guest domains (not for the hardware domain).
---

This is the first part of previous patch series and originally consist only with necessary changes needed for guest domain suspend.

The second part can be found here:

    https://patchew.org/Xen/[email protected]/

---
Changes in V17:
- PSCI SYSTEM_SUSPEND is no longer advertised to the hardware domain via PSCI_FEATURES.
- Split arch_set_info_guest() into separate validate/apply helpers while keeping full PSR validation on the public path.
- Build and validate the PSCI vCPU context during SYSTEM_SUSPEND and store it in resume_ctx.
- Make resume use only the prevalidated context and free it afterward; add resume_ctx_reset() and cleanup in arch_domain_destroy().
- Make arch_domain_resume() void and drop the error path from domain_resume().

Changes in V16:
- Refactor error handling in domain_resume: move logging to generic code, use explicit return code checking.
- Make context clearing conditional on success in arch_domain_resume.

Mykola Kvach (4):
xen/arm: Implement PSCI SYSTEM_SUSPEND call for guests tools/xl: Allow compilation of 'xl resume' command on Arm SUPPORT.md: Document PSCI SYSTEM_SUSPEND support for guests
CHANGELOG: Document guest suspend/resume to RAM support on Arm

 CHANGELOG.md                          |   4 +
 SUPPORT.md                            |   5 +-
 tools/include/libxl.h                 |   1 -
 tools/xl/xl.h                         |   4 +-
 tools/xl/xl_cmdtable.c                |   4 +-
 tools/xl/xl_migrate.c                 |   2 +-
 tools/xl/xl_saverestore.c             |   2 +-
 tools/xl/xl_vmcontrol.c               |  12 +--
 xen/arch/arm/domain.c                 |  86 ++++++++++++---
 xen/arch/arm/include/asm/domain.h     |   7 ++
 xen/arch/arm/include/asm/perfc_defn.h |   1 +
 xen/arch/arm/include/asm/psci.h       |   2 +
 xen/arch/arm/include/asm/suspend.h    |  27 +++++
 xen/arch/arm/include/asm/vpsci.h      |   2 +-
 xen/arch/arm/vpsci.c                  | 146 +++++++++++++++++++++-----
 xen/common/domain.c                   |   4 +
 xen/include/xen/suspend.h             |  25 +++++
 17 files changed, 277 insertions(+), 57 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/suspend.h
 create mode 100644 xen/include/xen/suspend.h
Signature · 1 line
2.43.0