From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Mykola Kvach <xakep.amatop@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Mykola Kvach" <Mykola_Kvach@epam.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Rahul Singh" <rahul.singh@arm.com>
Subject: Re: [PATCH v6 00/13] Add initial Xen Suspend-to-RAM support on ARM64
Date: Tue, 2 Sep 2025 20:48:21 +0000 [thread overview]
Message-ID: <87qzwovawb.fsf@epam.com> (raw)
In-Reply-To: <cover.1756763487.git.mykola_kvach@epam.com> (Mykola Kvach's message of "Tue, 2 Sep 2025 01:10:04 +0300")
Hi Mykola,
Mykola Kvach <xakep.amatop@gmail.com> writes:
> From: Mykola Kvach <mykola_kvach@epam.com>
>
> This is part 2 of version 5 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://marc.info/?l=xen-devel&m=175659181415965&w=2
>
> This version is ported to Xen master (4.21-unstable) 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 domains.
>
> At a high-level, this patch series provides:
> - Support for Host system suspend/resume via PSCI SYSTEM_SUSPEND
> (ARM64)
I am wondering if you had to split this into 3 patches. Looks like patches
8 and 9 are useless without patch 10. They just add bunch of dead
code. Maybe it is better to squash them into one patch? I may be wrong
here, so maybe other reviewers/maintainers will correct me.
> - Suspend/resume infrastructure for CPU context, timers, GICv2/GICv3 and IPMMU-VMSA
> - Proper error propagation and recovery throughout the suspend/resume flow
>
> Key updates in this series:
> - Introduced architecture-specific suspend/resume infrastructure (new `suspend.c`, `suspend.h`, low-level context save/restore in `head.S`)
> - 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 context save/restore
> - Added support for GICv3 eSPI registers context save/restore
>
> ---
> TODOs:
> - Test system suspend with llc_coloring_enabled set and verify functionality
> - Implement SMMUv3 suspend/resume handlers
> - 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)
> - Investigate feasibility and need for implementing system suspend on ARM32
> ---
>
> Changelog for v6:
> - Add suspend/resume support for GICv3 eSPI registers (to be applied after the
> main eSPI series).
> - Drop redundant iommu_enabled check from host system suspend.
> - Switch from continue_hypercall_on_cpu to a dedicated tasklet for system
> suspend, avoiding user register modification and decoupling guest/system
> suspend status.
> - Refactor IOMMU register context code.
> - Improve IRQ handling: call handler->disable(), move system state checks, and
> skip IRQ release during suspend inside release_irq().
> - Remove redundant GICv3 save/restore state logic now handled during vCPU
> context switch.
> - Clarify and unify error/warning messages, comments, and documentation.
> - Correct loops for saving/restoring priorities and merge loops where possible.
> - Add explicit error for unimplemented ITS suspend support.
> - Add missing GICD_CTLR_DS bit definition and clarify GICR_WAKER comments.
> - Cleanup active and enable registers before restoring.
> - Minor comment improvements and code cleanups.
>
> Changes introduced in V5:
> - Add support for IPMMU-VMSA context save/restore
> - Add support for GICv3 context save/restore
> - Select HAS_SYSTEM_SUSPEND in ARM_64 instead of ARM
> - Check llc_coloring_enabled instead of LLC_COLORING during the selection
> of HAS_SYSTEM_SUSPEND config
> - Call host_system_suspend from guest PSCI system suspend instead of
> arch_domain_shutdown, reducing the complexity of the new code
>
> Changes introduced in V4:
> - Remove the prior tasklet-based workaround in favor of a more
> straightforward and safer solution.
> - Rework the approach by adding explicit system state checks around
> request_irq and release_irq calls; skip these calls during suspend
> and resume states to avoid unsafe memory operations when IRQs are
> disabled.
> - Prevent reinitialization of local IRQ descriptors on system resume.
> - Restore the state of local IRQs during system resume for secondary CPUs.
> - Drop code for saving and restoring VCPU context (see part 1 of the patch
> series for details).
> - Remove IOMMU suspend and resume calls until these features are implemented.
> - Move system suspend logic to arch_domain_shutdown, invoked from
> domain_shutdown.
> - Add console_end_sync to the resume path after system suspend.
> - Drop unnecessary DAIF masking; interrupts are already masked on resume.
> - Remove leftover TLB flush instructions; flushing is handled in enable_mmu.
> - Avoid setting x19 in hyp_resume as it is not required.
> - Replace prepare_secondary_mm with set_init_ttbr, and call it from system_suspend.
> - Produce a build-time error for ARM32 when CONFIG_SYSTEM_SUSPEND is enabled.
> - Use register_t instead of uint64_t in the cpu_context structure.
> - Apply minor fixes such as renaming functions, updating comments, and
> modifying commit messages to accurately reflect the changes introduced
> by this patch series.
>
> For earlier changelogs, please refer to the previous cover letters.
>
> Previous versions:
> V1: https://marc.info/?l=xen-devel&m=154202231501850&w=2
> V2: https://marc.info/?l=xen-devel&m=166514782207736&w=2
> V3: https://lists.xen.org/archives/html/xen-devel/2025-03/msg00168.html
>
> Mirela Simonovic (6):
> xen/arm: Add suspend and resume timer helpers
> xen/arm: gic-v2: Implement GIC suspend/resume functions
> xen/arm: Implement PSCI SYSTEM_SUSPEND call (host interface)
> xen/arm: Resume memory management on Xen resume
> xen/arm: Save/restore context on suspend/resume
> xen/arm: Add support for system suspend triggered by hardware domain
>
> Mykola Kvach (5):
> xen/arm: gic-v3: Implement GICv3 suspend/resume functions
> xen/arm: Don't release IRQs on suspend
> xen/arm: irq: avoid local IRQ descriptors reinit on system resume
> xen/arm: irq: Restore state of local IRQs during system resume
> xen/arm: gic-v3: Add suspend/resume support for eSPI registers
>
> Oleksandr Tyshchenko (2):
> iommu/ipmmu-vmsa: Implement suspend/resume callbacks
> xen/arm: Suspend/resume IOMMU on Xen suspend/resume
>
> xen/arch/arm/Kconfig | 1 +
> xen/arch/arm/Makefile | 1 +
> xen/arch/arm/arm64/head.S | 112 +++++++++
> xen/arch/arm/gic-v2.c | 143 +++++++++++
> xen/arch/arm/gic-v3-lpi.c | 3 +
> xen/arch/arm/gic-v3.c | 288 +++++++++++++++++++++++
> xen/arch/arm/gic.c | 32 +++
> xen/arch/arm/include/asm/gic.h | 12 +
> xen/arch/arm/include/asm/gic_v3_defs.h | 1 +
> xen/arch/arm/include/asm/mm.h | 2 +
> xen/arch/arm/include/asm/psci.h | 1 +
> xen/arch/arm/include/asm/suspend.h | 46 ++++
> xen/arch/arm/include/asm/time.h | 5 +
> xen/arch/arm/irq.c | 46 ++++
> xen/arch/arm/mmu/smpboot.c | 2 +-
> xen/arch/arm/psci.c | 23 +-
> xen/arch/arm/suspend.c | 175 ++++++++++++++
> xen/arch/arm/tee/ffa_notif.c | 2 +-
> xen/arch/arm/time.c | 49 +++-
> xen/arch/arm/vpsci.c | 9 +-
> xen/common/domain.c | 4 +
> xen/drivers/passthrough/arm/ipmmu-vmsa.c | 257 ++++++++++++++++++++
> xen/drivers/passthrough/arm/smmu-v3.c | 10 +
> xen/drivers/passthrough/arm/smmu.c | 10 +
> 24 files changed, 1220 insertions(+), 14 deletions(-)
> create mode 100644 xen/arch/arm/include/asm/suspend.h
> create mode 100644 xen/arch/arm/suspend.c
--
WBR, Volodymyr
prev parent reply other threads:[~2025-09-02 20:48 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 22:10 [PATCH v6 00/13] Add initial Xen Suspend-to-RAM support on ARM64 Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 01/13] xen/arm: Add suspend and resume timer helpers Mykola Kvach
2025-09-02 20:14 ` Volodymyr Babchuk
2025-09-12 23:04 ` Julien Grall
2025-11-21 8:10 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 02/13] xen/arm: gic-v2: Implement GIC suspend/resume functions Mykola Kvach
2025-09-02 20:24 ` Volodymyr Babchuk
2025-09-12 23:30 ` Julien Grall
2025-09-17 3:29 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 03/13] xen/arm: gic-v3: Implement GICv3 " Mykola Kvach
2025-09-02 16:08 ` Oleksandr Tyshchenko
2025-09-02 17:30 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 04/13] xen/arm: Don't release IRQs on suspend Mykola Kvach
2025-09-02 20:31 ` Volodymyr Babchuk
2025-09-12 23:45 ` Julien Grall
2025-09-17 2:22 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 05/13] xen/arm: irq: avoid local IRQ descriptors reinit on system resume Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 06/13] xen/arm: irq: Restore state of local IRQs during " Mykola Kvach
2025-09-02 16:49 ` Oleksandr Tyshchenko
2025-09-02 17:43 ` Mykola Kvach
2025-09-02 18:16 ` Oleksandr Tyshchenko
2025-09-02 20:08 ` Mykola Kvach
2025-09-02 20:19 ` Mykola Kvach
2025-09-02 22:21 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 07/13] iommu/ipmmu-vmsa: Implement suspend/resume callbacks Mykola Kvach
2025-09-02 20:39 ` Volodymyr Babchuk
2025-09-03 10:01 ` Oleksandr Tyshchenko
2025-09-03 10:25 ` Mykola Kvach
2025-09-03 11:49 ` Oleksandr Tyshchenko
2025-09-03 15:12 ` Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 08/13] xen/arm: Implement PSCI SYSTEM_SUSPEND call (host interface) Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 09/13] xen/arm: Resume memory management on Xen resume Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 10/13] xen/arm: Save/restore context on suspend/resume Mykola Kvach
2025-09-01 22:10 ` [PATCH v6 11/13] xen/arm: Add support for system suspend triggered by hardware domain Mykola Kvach
2025-09-02 5:56 ` Mykola Kvach
2025-09-02 14:33 ` Jan Beulich
2025-09-03 4:31 ` Mykola Kvach
2025-09-09 6:29 ` Mykola Kvach
2025-09-09 6:57 ` Jan Beulich
2025-09-09 8:14 ` Mykola Kvach
2025-09-09 9:14 ` Jan Beulich
2025-09-09 9:55 ` Mykola Kvach
2025-09-09 11:48 ` Jan Beulich
2025-09-01 22:10 ` [PATCH v6 12/13] xen/arm: Suspend/resume IOMMU on Xen suspend/resume Mykola Kvach
2025-09-02 17:25 ` Oleksandr Tyshchenko
2025-09-02 17:46 ` Mykola Kvach
2025-09-02 20:51 ` Volodymyr Babchuk
2025-09-01 22:10 ` [PATCH v6 13/13] xen/arm: gic-v3: Add suspend/resume support for eSPI registers Mykola Kvach
2025-09-02 20:48 ` Volodymyr Babchuk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87qzwovawb.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=Mykola_Kvach@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=rahul.singh@arm.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xakep.amatop@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.