[PATCH 13/16] xen/arm: Implement PSCI SYSTEM_SUSPEND call (physical interface)

2025-03-05 Thread Mykola Kvach
assembly. Context ID, which is 2nd argument of system suspend PSCI call, is unused, as in Linux. Signed-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- Changes introduced in v3: - return PSCI_NOT_SUPPORTED instead of 1 for arm32

Re: [PATCH 00/16] Suspend to RAM support for Xen on arm64

2025-03-05 Thread Mykola Kvach
On Wed, Mar 5, 2025 at 11:11 AM Mykola Kvach wrote: > > This is V1 series from Mirela Simonovic. Ported to 4.16 and with added changes > suggested here > https://lore.kernel.org/all/CAKPH-NjmaZENb8gT=+fobraycrf01_--6gura2ck9di5wiu...@mail.gmail.com > > This is V2 series f

[PATCH 04/16] xen/cpu: prevent disable_nonboot_cpus crash on ARM64

2025-03-05 Thread Mykola Kvach
. The first part triggers the CPU_DYING call chain, while the second part, __cpu_disable, is invoked from stop_machine_run. Signed-off-by: Mykola Kvach --- This patch was introduced in patch series V3. --- xen/common/cpu.c | 43 +++ 1 file changed, 43 insertions(+) di

[PATCH 14/16] xen/arm: Resume memory management on Xen resume

2025-03-05 Thread Mykola Kvach
: Mykyta Poturai Signed-off-by: Mykola Kvach --- Changes in V3: - updated commit message - instead of using create_page_tables, enable_mmu, and mmu_init_secondary_cpu, the existing function enable_secondary_cpu_mm is now used - prepare_secondary_mm (previously init_secondary_pagetables in the

[PATCH 11/16] xen/arm: Implement PSCI system suspend

2025-03-05 Thread Mykola Kvach
-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- Changes in V3: Dropped all domain flags and related code (which touched common functions like vcpu_unblock), keeping only the necessary changes for Xen suspend/resume, i.e. suspend/resu

[PATCH 16/16] CHANGELOG: Mention Xen suspend/resume to RAM feature on arm64

2025-03-05 Thread Mykola Kvach
Signed-off-by: Mykola Kvach --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c21d5bce..489404fc8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0

[PATCH 15/16] xen/arm: Save/restore context on suspend/resume

2025-03-05 Thread Mykola Kvach
d Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- xen/arch/arm/arm64/head.S | 88 +- xen/arch/arm/include/asm/suspend.h | 22 xen/arch/arm/suspend.c | 22 +++- 3 files changed, 128 insertions(+), 4 deletions(-)

[PATCH 05/16] xen/percpu: don't initialize percpu on resume

2025-03-05 Thread Mykola Kvach
pu_offset[cpu] != INVALID_PERCPU_AREA ) return park_offline_cpus ? 0 : -EBUSY; It appears that the same crash can occur on x86 if park_offline_cpus is set to 0 during Xen suspend. Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- These changes were introduced in V2 inside "x

[PATCH 09/16] xen/arm: add suspend and resume timer helpers

2025-03-05 Thread Mykola Kvach
will trigger the generic timer code to reprogram the EL2 timer as needed. Enabling of EL1 physical timer will be triggered by an entity which uses it. Signed-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykola Kvach --- xen/arch/arm/include/asm/time.h | 5 + xen

[PATCH 02/16] xen/x86: Move freeze/thaw_domains into common files

2025-03-05 Thread Mykola Kvach
From: Mirela Simonovic These functions will be reused by suspend/resume support for ARM. Signed-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- xen/arch/x86/acpi/power.c | 29 - xen/common

[PATCH 00/16] Suspend to RAM support for Xen on arm64

2025-03-05 Thread Mykola Kvach
m suspend xen/arm: Trigger Xen suspend when hardware domain completes suspend xen/arm: Implement PSCI SYSTEM_SUSPEND call (physical interface) xen/arm: Resume memory management on Xen resume xen/arm: Save/restore context on suspend/resume Mykola Kvach (6): xen/cpu: prevent disable_non

[PATCH 03/16] xen/arm: introduce a separate struct for watchdog timers

2025-03-05 Thread Mykola Kvach
struct watchdog_timer is introduced, containing the original timer and the last set timeout. Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- This commit was introduced in patch series V2. --- xen/common/keyhandler.c| 2 +- xen/common/sched/core.c| 11 ++- xen/include

[PATCH 12/16] xen/arm: Trigger Xen suspend when hardware domain completes suspend

2025-03-05 Thread Mykola Kvach
. Signed-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- Changes introduced in V3: Merged changes from other commits into this one (stashed changes): - disabled/enabled non-boot physical CPUs and froze/thawed domains

[PATCH 10/16] xen/arm: Implement GIC suspend/resume functions (gicv2 only)

2025-03-05 Thread Mykola Kvach
accessible by guests are saved/restored on context switch. Tested on Xilinx Ultrascale+ MPSoC with (and without) powering down the GIC. Signed-off-by: Mirela Simonovic Signed-off-by: Saeed Nowshadi Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- changes in v3: - drop asserts, return error

[PATCH 08/16] xen/arm: add watchdog domain suspend/resume helpers

2025-03-05 Thread Mykola Kvach
From: Mykola Kvach This patch implements suspend/resume helpers for the watchdog. While a domain is suspended its watchdogs must be paused. Otherwise, if the domain stays in the suspend state for a longer period of time compared to the watchdog period, the domain would be shutdown on resume

[PATCH 01/16] iommu: Add checks before calling iommu suspend/resume

2025-03-05 Thread Mykola Kvach
From: Mykyta Poturai These functions may be unimplemented, so check that they exist before calling to prevent crashes. Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- Introduced in patch series V3. --- xen/drivers/passthrough/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 07/16] xen/char: implement suspend/resume calls for SCIF driver

2025-03-05 Thread Mykola Kvach
From: Mykola Kvach The changes have been tested only on the Renesas R-Car-H3 Starter Kit board. Signed-off-by: Volodymyr Babchuk Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Mykola Kvach --- xen/drivers/char/scif-uart.c | 31 ++- 1 file changed, 30

[PATCH 06/16] xen/arm: Introduce system suspend config option

2025-03-05 Thread Mykola Kvach
From: Mykola Kvach This option enables the system suspend support. This is the mechanism that allows the system to be suspended to RAM and later resumed. Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- xen/arch/arm/Kconfig | 11 +++ 1 file changed, 11 insertions