From: Mykola Kvach <mykola_kvach@epam.com>
This is part 2 of version 7 of the ARM Xen system suspend/resume patch
series, based on earlier work by Mirela Simonovic and Mykyta Poturai.
The first part is here:
https://patchew.org/Xen/cover.1764755558.git.xakep.amatop@gmail.com/
NOTE: Most of the code is guarded by CONFIG_SYSTEM_SUSPEND, which can
currently only be selected when UNSUPPORTED is set, and thus the
functionality is neither enabled by default nor even built.
This version is ported to Xen master and includes extensive improvements
based on reviewer feedback. The patch series restructures code to improve
robustness, maintainability, and implements system Suspend-to-RAM support
on ARM64 hardware/control domains.
Key updates in this series:
- Introduced architecture-specific suspend/resume infrastructure
- Integrated GICv2/GICv3 suspend and resume, including memory-backed context
save/restore with error handling
- Added time and IRQ suspend/resume hooks, ensuring correct timer/interrupt
state across suspend cycles
- Implemented proper PSCI SYSTEM_SUSPEND invocation and version checks
- Improved state management and recovery in error cases during suspend/resume
- Added support for IPMMU-VMSA/SMMUv3 context save/restore
- Added support for GICv3 eSPI registers context save/restore
- Added support for ITS registers context save/restore
---
TODOs:
- Enable "xl suspend" support on ARM
- Properly disable Xen timer watchdog from relevant services (only init.d left)
- Add suspend/resume CI test for ARM (QEMU if feasible)
---
Detailed changelogs can be found in each patch.
Changes in v7:
- Timer helper renamed/clarified; virtual/hyper/phys handling documented.
- GICv2 uses one context block; restore saved CTLR; panic on alloc failure.
- GICv3/eSPI/ITS always suspend/resume; restore LPI/eSPI; rdist timeout.
- IPMMU suspend context allocated before PCI setup.
- System suspend: control domain drives host suspend.
- Dropped v6 IRQ descriptor restore patches; use setup_irq and re-register
local IRQs on resume instead.
For earlier changelogs, please refer to the previous cover letters.
Mirela Simonovic (6):
xen/arm: Add suspend and resume timer helpers
xen/arm: gic-v2: Implement GIC suspend/resume functions
xen/arm: Resume memory management on Xen resume
xen/arm: Save/restore context on suspend/resume
xen/arm: Implement PSCI SYSTEM_SUSPEND call (host interface)
xen/arm: Add support for system suspend triggered by control domain
Mykola Kvach (5):
xen/arm: gic-v3: Implement GICv3 suspend/resume functions
xen/arm: gic-v3: add ITS suspend/resume support
xen/arm: tee: keep init_tee_secondary() for hotplug and resume
xen/arm: ffa: fix notification SRI across CPU hotplug/suspend
arm/smmu-v3: add suspend/resume handlers
Oleksandr Tyshchenko (1):
iommu/ipmmu-vmsa: Implement suspend/resume callbacks
xen/arch/arm/Kconfig | 1 +
xen/arch/arm/Makefile | 1 +
xen/arch/arm/arm64/head.S | 112 ++++++++
xen/arch/arm/gic-v2.c | 126 +++++++++
xen/arch/arm/gic-v3-its.c | 91 +++++++
xen/arch/arm/gic-v3-lpi.c | 3 +
xen/arch/arm/gic-v3.c | 332 ++++++++++++++++++++++-
xen/arch/arm/gic.c | 29 ++
xen/arch/arm/include/asm/gic.h | 12 +
xen/arch/arm/include/asm/gic_v3_defs.h | 1 +
xen/arch/arm/include/asm/gic_v3_its.h | 23 ++
xen/arch/arm/include/asm/mm.h | 2 +
xen/arch/arm/include/asm/psci.h | 1 +
xen/arch/arm/include/asm/suspend.h | 31 +++
xen/arch/arm/include/asm/time.h | 5 +
xen/arch/arm/mmu/smpboot.c | 2 +-
xen/arch/arm/psci.c | 23 +-
xen/arch/arm/suspend.c | 153 +++++++++++
xen/arch/arm/tee/ffa_notif.c | 63 ++++-
xen/arch/arm/tee/tee.c | 2 +-
xen/arch/arm/time.c | 44 ++-
xen/arch/arm/vpsci.c | 12 +-
xen/common/Kconfig | 5 +
xen/common/domain.c | 7 +-
xen/drivers/passthrough/arm/ipmmu-vmsa.c | 305 ++++++++++++++++++++-
xen/drivers/passthrough/arm/smmu-v3.c | 170 +++++++++---
xen/drivers/passthrough/arm/smmu.c | 10 +
xen/include/xen/list.h | 14 +
28 files changed, 1507 insertions(+), 73 deletions(-)
create mode 100644 xen/arch/arm/suspend.c
--
2.43.0