From nobody Fri Apr 3 10:20:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1774355366; cv=none; d=zohomail.com; s=zohoarc; b=jAfvyaJcIk+A9KkWLMg8SKCW1lEBn9g/P8/ZVJA3xMiE1aOQyK7VU5mSq88H0QPYtOrlM6VJh//N8cYhMDZ7sFiOxgcHHktJcYkHetepdLskIoTjD5njXT9D98umZ75Jxhh2k7ux1IByVheTDoyz2wmEzSem1eecpptNMe7Ulkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774355366; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7/6HJhyhtErbpXXGpZoU8/+KkesjpSkybuifOG8Ybk8=; b=DPVDi7S9ssikPXrdAsm99Tler/bLnrbRNbyhgmFYj3ri9PER2MWHyTr8swvtWjCBWajBCBd6KDlHmbKLgkja9fL9d6lBb4dSnBuxp//F8j5PYTuaX7IzB2bemge3zcO3Pon4Dn9rMy+gX4eKiXnkkuMuDX39p7HTIrj2/DoW290= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774355366498825.4098838330758; Tue, 24 Mar 2026 05:29:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1260572.1553836 (Exim 4.92) (envelope-from ) id 1w50sT-0000lF-Ap; Tue, 24 Mar 2026 12:28:57 +0000 Received: by outflank-mailman (output) from mailman id 1260572.1553836; Tue, 24 Mar 2026 12:28:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sT-0000kc-7C; Tue, 24 Mar 2026 12:28:57 +0000 Received: by outflank-mailman (input) for mailman id 1260572; Tue, 24 Mar 2026 12:28:56 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sR-0000ij-TD for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 12:28:56 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w50sR-00AZEX-8w for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 13:28:55 +0100 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c28380-5cb7-0a2a0a5109dd-0a2a4506af42-14 for ; Tue, 24 Mar 2026 13:28:55 +0100 Received: from [209.85.218.51] (helo=mail-ej1-f51.google.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c28387-3034-0a2a45060019-d155da33d566-3 for ; Tue, 24 Mar 2026 13:28:55 +0100 Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b9358dd7f79so639825266b.1 for ; Tue, 24 Mar 2026 05:28:55 -0700 (PDT) Received: from EPUAKYIW02F7.. ([45.12.26.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9832f43ae8sm638180966b.6.2026.03.24.05.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 05:28:53 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774355334; x=1774960134; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7/6HJhyhtErbpXXGpZoU8/+KkesjpSkybuifOG8Ybk8=; b=WGbybabhSYWkINqbcNakJP9fC67jcffTm0rIyPNI1m52uNjIA91/ysMdGo9SG4p29P JkB7sXnE7xTiqxHgX2gciPne8tPIgQOoURsLaZvT61ncsDXWdK+UW8W1KFj1L84ToMd7 E/rH4wcI9jBGvd+VzXd0m8whIaUd4q2m0cl8Zepy62ulDD1K+i9qq1HFI56plYaTPl30 Ak9PQ30A1g+ym6vWx8NhjcQnr4giIjmV5QwQuAknmFwDm8CLcDhJtz8QbDMUArc3edXj f348+KfDG6KKLG0AK0+vd5mqxFiFk5+vByBm5AHTrwy1DLDcM3Zxf67vV5q5H03OlLJm 47EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774355334; x=1774960134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7/6HJhyhtErbpXXGpZoU8/+KkesjpSkybuifOG8Ybk8=; b=LWm7U2O531FJ2jo6Ask8T9fepC576/p2czZXyNDZSUMzIE41mxG38N/FUNMajicEbI vfDiMMjsVMwf/7ZqbC4DcixMf7nL1P1tj5PPYn4qskLuECTGfLoMiQZbUhzsWvk3Tg+T T2SzvU4C+WBKtv1beaEtNDQxYeGVLE45PXvMxEudl97YaudvY3ShL/AEMs3ijhK2QRxi hmJ/nJAy9MhgEtlTR+NsQr2HI7Kj4rYwWp1cmWVRp2xSvqZM8YUYMf375HuWZ/T/w/Po D1OLtCvcBs4kuQuewdhLBlAHfYXY3ClQPpw+vXx3V8TNF99V4/awtuyNZKHWeBrHfT2x SMgg== X-Gm-Message-State: AOJu0YzDApcCw02gRHMJ9Lcxj/lx24x5jIYZi++wov9+ErM/KWCy6hu8 D7W3SDsacrnuIm7wWoLShNgQbOaD8G3KbaKfwTETE5U5Btn/nRM+roAjATm+cA== X-Gm-Gg: ATEYQzyhSUakvdPAil1ENSukK1gh/9XbJrI2E08c3El5MPIlTSbisFWDGHeCZk8flK3 gQVyXQx7kuNCwnqUtVSmTo8EqfFv+VAdW+omugxinyCEu04Q39WoEKNvLi8wCgyJ7K1eMMPUQUJ 81n2izPL6F+xHDS8LJQ09iL9g5/4rIkhEDECChisadbFaKnZpv4uVZNWWm67hGxQCA5x1vDxWG+ fk2n0ggvJt/EBOo2eJgFBhflsvWcZzWR3bC1o8KmV6iVBjH8Qr+fPRfnDKTRPsqjfBLFV5q4PxJ 3r3+PHzFoZjhzC22OMmlCmqJyQyM5shHXk6yOIzoUtsCnOdqW2Xzf+CZ2Csy/HFHba6W9FI+YBF ux7sXqDBNPZO8jdXnQJoWqZZj65EB3xopbd1OGpb1849dhGqNPq++MEvCCK7RHW+LN+efcLCNab FIEf6AvqRlEpZq+pinvppCCKwjb+Y= X-Received: by 2002:a17:906:8a68:b0:b98:1214:1376 with SMTP id a640c23a62f3a-b982f3e6d8dmr872300866b.49.1774355334169; Tue, 24 Mar 2026 05:28:54 -0700 (PDT) From: Mykola Kvach To: xen-devel@lists.xenproject.org Cc: Mykola Kvach , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v17 1/4] xen/arm: Implement PSCI SYSTEM_SUSPEND call for guests Date: Tue, 24 Mar 2026 14:26:34 +0200 Message-ID: <581179709977ce4cebb22597411048dc93b11167.1774353053.git.mykola_kvach@epam.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-16d1c6/1774355335-82F941C2-A0D50685/0/0 X-purgate-type: clean X-purgate-size: 18144 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1774355367734154100 Content-Type: text/plain; charset="utf-8" From: Mykola Kvach Add support for the PSCI SYSTEM_SUSPEND function in the vPSCI interface, allowing guests to request suspend via the PSCI v1.0+ SYSTEM_SUSPEND call (both 32-bit and 64-bit variants). Implementation details: - Add SYSTEM_SUSPEND function IDs to PSCI definitions - Trap and handle SYSTEM_SUSPEND in vPSCI - Reject SYSTEM_SUSPEND for the hardware domain to avoid host shutdown - Require all secondary VCPUs to be offline before suspend - Split arch_set_info_guest() into arch_vcpu_validate_guest_context() and arch_vcpu_apply_guest_context() for reuse by vPSCI - Add vpsci_build_guest_context() helper and store prevalidated context in resume_ctx; resume applies it and frees it - Add arch_domain_resume() function is an architecture-specific hook that is invoked during domain resume to perform any necessary setup or restoration steps required by the platform. Usage: For Linux-based guests, suspend can be initiated with: echo mem > /sys/power/state or via: systemctl suspend Resume from control domain: xl resume Signed-off-by: Mykola Kvach Reviewed-by: Michal Orzel --- Changes in V17: - PSCI SYSTEM_SUSPEND is no longer advertised to the hardware domain via PSCI_FEATURES. - Split arch_set_info_guest() into validate/apply helpers; keep full PSR validation on the public path. - Build and validate PSCI vCPU context at SYSTEM_SUSPEND time, store it in resume_ctx. - Make resume path apply only the prevalidated context and free it; add resume_ctx_reset() and cleanup in arch_domain_destroy(). - Rework vPSCI CPU_ON to use build/apply/free path; resume_ctx now carries a vcpu_guest_context pointer (no ep/cid). - Make arch_domain_resume() void and remove the error branch 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. - The 'int' return type is retained for arch_domain_resume for consistency with other arch hooks and to allow for specific negative error codes. --- 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 +++++ 9 files changed, 258 insertions(+), 42 deletions(-) create mode 100644 xen/arch/arm/include/asm/suspend.h create mode 100644 xen/include/xen/suspend.h diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 94b9858ad2..581f82bddd 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -12,6 +12,8 @@ #include #include =20 +#include + #include #include #include @@ -24,10 +26,12 @@ #include #include #include +#include #include #include #include #include +#include #include =20 #include "vpci.h" @@ -770,8 +774,18 @@ int arch_domain_teardown(struct domain *d) return 0; } =20 +static void resume_ctx_reset(struct resume_info *ctx) +{ + if ( ctx->ctxt ) + free_vcpu_guest_context(ctx->ctxt); + + memset(ctx, 0, sizeof(*ctx)); +} + void arch_domain_destroy(struct domain *d) { + resume_ctx_reset(&d->arch.resume_ctx); + tee_free_domain_ctx(d); /* IOMMU page table is shared with P2M, always call * iommu_domain_destroy() before p2m_final_teardown(). @@ -806,6 +820,28 @@ void arch_domain_creation_finished(struct domain *d) p2m_domain_creation_finished(d); } =20 +void arch_domain_resume(struct domain *d) +{ + struct resume_info *ctx =3D &d->arch.resume_ctx; + + /* + * It is still possible to call domain_shutdown() with a suspend reason + * via some hypercalls, such as SCHEDOP_shutdown or SCHEDOP_remote_shu= tdown. + * In these cases, the resume context will be empty, so there is no + * suspend-specific state to restore. + */ + if ( !ctx->wake_cpu ) + return; + + ASSERT(d->shutdown_code =3D=3D SHUTDOWN_suspend); + + domain_lock(d); + arch_vcpu_apply_guest_context(ctx->wake_cpu, ctx->ctxt); + domain_unlock(d); + + resume_ctx_reset(ctx); +} + static int is_guest_pv32_psr(uint32_t psr) { switch (psr & PSR_MODE_MASK) @@ -848,15 +884,32 @@ static int is_guest_pv64_psr(uint64_t psr) } #endif =20 +void arch_vcpu_apply_guest_context(struct vcpu *v, + const struct vcpu_guest_context *ctxt) +{ + vcpu_regs_user_to_hyp(v, &ctxt->user_regs); + + v->arch.sctlr =3D ctxt->sctlr; + v->arch.ttbr0 =3D ctxt->ttbr0; + v->arch.ttbr1 =3D ctxt->ttbr1; + v->arch.ttbcr =3D ctxt->ttbcr; + + v->is_initialised =3D 1; + + if ( ctxt->flags & VGCF_online ) + clear_bit(_VPF_down, &v->pause_flags); + else + set_bit(_VPF_down, &v->pause_flags); +} + /* * Initialise vCPU state. The context may be supplied by an external entit= y, so * we need to validate it. */ -int arch_set_info_guest( - struct vcpu *v, vcpu_guest_context_u c) +int arch_vcpu_validate_guest_context(const struct vcpu *v, + const struct vcpu_guest_context *ctxt) { - struct vcpu_guest_context *ctxt =3D c.nat; - struct vcpu_guest_core_regs *regs =3D &c.nat->user_regs; + const struct vcpu_guest_core_regs *regs =3D &ctxt->user_regs; =20 if ( is_32bit_domain(v->domain) ) { @@ -885,19 +938,24 @@ int arch_set_info_guest( } #endif =20 - vcpu_regs_user_to_hyp(v, regs); + return 0; +} =20 - v->arch.sctlr =3D ctxt->sctlr; - v->arch.ttbr0 =3D ctxt->ttbr0; - v->arch.ttbr1 =3D ctxt->ttbr1; - v->arch.ttbcr =3D ctxt->ttbcr; +/* + * Initialise vCPU state. The context may be supplied by an external entit= y, so + * we need to validate it. + */ +int arch_set_info_guest( + struct vcpu *v, vcpu_guest_context_u c) +{ + struct vcpu_guest_context *ctxt =3D c.nat; + int rc; =20 - v->is_initialised =3D 1; + rc =3D arch_vcpu_validate_guest_context(v, ctxt); + if ( rc ) + return rc; =20 - if ( ctxt->flags & VGCF_online ) - clear_bit(_VPF_down, &v->pause_flags); - else - set_bit(_VPF_down, &v->pause_flags); + arch_vcpu_apply_guest_context(v, ctxt); =20 return 0; } diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/d= omain.h index 758ad807e4..ffe5d0d9f0 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ struct arch_domain void *sci_data; #endif =20 + struct resume_info resume_ctx; } __cacheline_aligned; =20 struct arch_vcpu @@ -290,6 +292,11 @@ static inline register_t vcpuid_to_vaffinity(unsigned = int vcpuid) return vaff; } =20 +int arch_vcpu_validate_guest_context(const struct vcpu *v, + const struct vcpu_guest_context *ctxt= ); +void arch_vcpu_apply_guest_context(struct vcpu *v, + const struct vcpu_guest_context *ctxt); + static inline struct vcpu_guest_context *alloc_vcpu_guest_context(void) { return xmalloc(struct vcpu_guest_context); diff --git a/xen/arch/arm/include/asm/perfc_defn.h b/xen/arch/arm/include/a= sm/perfc_defn.h index effd25b69e..8dfcac7e3b 100644 --- a/xen/arch/arm/include/asm/perfc_defn.h +++ b/xen/arch/arm/include/asm/perfc_defn.h @@ -33,6 +33,7 @@ PERFCOUNTER(vpsci_system_reset, "vpsci: system_res= et") PERFCOUNTER(vpsci_cpu_suspend, "vpsci: cpu_suspend") PERFCOUNTER(vpsci_cpu_affinity_info, "vpsci: cpu_affinity_info") PERFCOUNTER(vpsci_features, "vpsci: features") +PERFCOUNTER(vpsci_system_suspend, "vpsci: system_suspend") =20 PERFCOUNTER(vcpu_kick, "vcpu: notify other vcpu") =20 diff --git a/xen/arch/arm/include/asm/psci.h b/xen/arch/arm/include/asm/psc= i.h index 4780972621..48a93e6b79 100644 --- a/xen/arch/arm/include/asm/psci.h +++ b/xen/arch/arm/include/asm/psci.h @@ -47,10 +47,12 @@ void call_psci_system_reset(void); #define PSCI_0_2_FN32_SYSTEM_OFF PSCI_0_2_FN32(8) #define PSCI_0_2_FN32_SYSTEM_RESET PSCI_0_2_FN32(9) #define PSCI_1_0_FN32_PSCI_FEATURES PSCI_0_2_FN32(10) +#define PSCI_1_0_FN32_SYSTEM_SUSPEND PSCI_0_2_FN32(14) =20 #define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) #define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) #define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) +#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14) =20 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ #define PSCI_0_2_AFFINITY_LEVEL_ON 0 diff --git a/xen/arch/arm/include/asm/suspend.h b/xen/arch/arm/include/asm/= suspend.h new file mode 100644 index 0000000000..31a98a1f1b --- /dev/null +++ b/xen/arch/arm/include/asm/suspend.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef ARM_SUSPEND_H +#define ARM_SUSPEND_H + +struct domain; +struct vcpu; +struct vcpu_guest_context; + +struct resume_info { + struct vcpu_guest_context *ctxt; + struct vcpu *wake_cpu; +}; + +void arch_domain_resume(struct domain *d); + +#endif /* ARM_SUSPEND_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/arch/arm/include/asm/vpsci.h b/xen/arch/arm/include/asm/vp= sci.h index 0cca5e6830..69d40f9d7f 100644 --- a/xen/arch/arm/include/asm/vpsci.h +++ b/xen/arch/arm/include/asm/vpsci.h @@ -23,7 +23,7 @@ #include =20 /* Number of function implemented by virtual PSCI (only 0.2 or later) */ -#define VPSCI_NR_FUNCS 12 +#define VPSCI_NR_FUNCS 14 =20 /* Functions handle PSCI calls from the guests */ bool do_vpsci_0_1_call(struct cpu_user_regs *regs, uint32_t fid); diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c index 7ba9ccd94b..bd87ec430d 100644 --- a/xen/arch/arm/vpsci.c +++ b/xen/arch/arm/vpsci.c @@ -4,38 +4,24 @@ #include =20 #include +#include #include #include #include =20 #include =20 -static int do_common_cpu_on(register_t target_cpu, register_t entry_point, - register_t context_id) +static int vpsci_build_guest_context(struct vcpu *v, register_t entry_poin= t, + register_t context_id, + struct vcpu_guest_context **out) { - struct vcpu *v; - struct domain *d =3D current->domain; + bool is_thumb =3D entry_point & 1; struct vcpu_guest_context *ctxt; int rc; - bool is_thumb =3D entry_point & 1; - register_t vcpuid; - - vcpuid =3D vaffinity_to_vcpuid(target_cpu); =20 - if ( (v =3D domain_vcpu(d, vcpuid)) =3D=3D NULL ) - return PSCI_INVALID_PARAMETERS; - - /* THUMB set is not allowed with 64-bit domain */ - if ( is_64bit_domain(d) && is_thumb ) - return PSCI_INVALID_ADDRESS; - - if ( !test_bit(_VPF_down, &v->pause_flags) ) - return PSCI_ALREADY_ON; - - if ( (ctxt =3D alloc_vcpu_guest_context()) =3D=3D NULL ) - return PSCI_DENIED; - - vgic_clear_pending_irqs(v); + ctxt =3D alloc_vcpu_guest_context(); + if ( ctxt =3D=3D NULL ) + return -ENOMEM; =20 memset(ctxt, 0, sizeof(*ctxt)); ctxt->user_regs.pc64 =3D (u64) entry_point; @@ -48,7 +34,7 @@ static int do_common_cpu_on(register_t target_cpu, regist= er_t entry_point, * x0/r0_usr are always updated because for PSCI 0.1 the general * purpose registers are undefined upon CPU_on. */ - if ( is_32bit_domain(d) ) + if ( is_32bit_domain(v->domain) ) { ctxt->user_regs.cpsr =3D PSR_GUEST32_INIT; /* Start the VCPU with THUMB set if it's requested by the kernel */ @@ -69,15 +55,51 @@ static int do_common_cpu_on(register_t target_cpu, regi= ster_t entry_point, #endif ctxt->flags =3D VGCF_online; =20 - domain_lock(d); - rc =3D arch_set_info_guest(v, ctxt); - domain_unlock(d); + rc =3D arch_vcpu_validate_guest_context(v, ctxt); + if ( rc ) + { + free_vcpu_guest_context(ctxt); + return rc; + } =20 - free_vcpu_guest_context(ctxt); + *out =3D ctxt; + return 0; +} + +static int do_common_cpu_on(register_t target_cpu, register_t entry_point, + register_t context_id) +{ + struct vcpu *v; + struct domain *d =3D current->domain; + struct vcpu_guest_context *ctxt =3D NULL; + int rc; + bool is_thumb =3D entry_point & 1; + register_t vcpuid; + + vcpuid =3D vaffinity_to_vcpuid(target_cpu); + + if ( (v =3D domain_vcpu(d, vcpuid)) =3D=3D NULL ) + return PSCI_INVALID_PARAMETERS; + + /* THUMB set is not allowed with 64-bit domain */ + if ( is_64bit_domain(d) && is_thumb ) + return PSCI_INVALID_ADDRESS; =20 + if ( !test_bit(_VPF_down, &v->pause_flags) ) + return PSCI_ALREADY_ON; + + rc =3D vpsci_build_guest_context(v, entry_point, context_id, &ctxt); if ( rc < 0 ) return PSCI_DENIED; =20 + vgic_clear_pending_irqs(v); + + domain_lock(d); + arch_vcpu_apply_guest_context(v, ctxt); + domain_unlock(d); + + free_vcpu_guest_context(ctxt); + vcpu_wake(v); =20 return PSCI_SUCCESS; @@ -197,6 +219,56 @@ static void do_psci_0_2_system_reset(void) domain_shutdown(d,SHUTDOWN_reboot); } =20 +static int32_t do_psci_1_0_system_suspend(register_t epoint, register_t ci= d) +{ + int32_t rc; + struct vcpu_guest_context *ctxt; + struct vcpu *v; + struct domain *d =3D current->domain; + bool is_thumb =3D epoint & 1; + struct resume_info *rctx =3D &d->arch.resume_ctx; + + /* THUMB set is not allowed with 64-bit domain */ + if ( is_64bit_domain(d) && is_thumb ) + return PSCI_INVALID_ADDRESS; + + /* SYSTEM_SUSPEND is not supported for the hardware domain yet */ + if ( is_hardware_domain(d) ) + return PSCI_NOT_SUPPORTED; + + /* Ensure that all CPUs other than the calling one are offline */ + domain_lock(d); + for_each_vcpu ( d, v ) + { + if ( v !=3D current && is_vcpu_online(v) ) + { + domain_unlock(d); + return PSCI_DENIED; + } + } + domain_unlock(d); + + rc =3D vpsci_build_guest_context(current, epoint, cid, &ctxt); + if ( rc ) + return PSCI_DENIED; + + rc =3D domain_shutdown(d, SHUTDOWN_suspend); + if ( rc ) + { + free_vcpu_guest_context(ctxt); + return PSCI_DENIED; + } + + rctx->ctxt =3D ctxt; + rctx->wake_cpu =3D current; + + gprintk(XENLOG_DEBUG, + "SYSTEM_SUSPEND requested, epoint=3D%#"PRIregister", cid=3D%#"= PRIregister"\n", + epoint, cid); + + return rc; +} + static int32_t do_psci_1_0_features(uint32_t psci_func_id) { /* /!\ Ordered by function ID and not name */ @@ -216,6 +288,9 @@ static int32_t do_psci_1_0_features(uint32_t psci_func_= id) case PSCI_1_0_FN32_PSCI_FEATURES: case ARM_SMCCC_VERSION_FID: return 0; + case PSCI_1_0_FN32_SYSTEM_SUSPEND: + case PSCI_1_0_FN64_SYSTEM_SUSPEND: + return is_hardware_domain(current->domain) ? PSCI_NOT_SUPPORTED : = 0; default: return PSCI_NOT_SUPPORTED; } @@ -344,6 +419,23 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uin= t32_t fid) return true; } =20 + case PSCI_1_0_FN32_SYSTEM_SUSPEND: + case PSCI_1_0_FN64_SYSTEM_SUSPEND: + { + register_t epoint =3D PSCI_ARG(regs, 1); + register_t cid =3D PSCI_ARG(regs, 2); + + if ( fid =3D=3D PSCI_1_0_FN32_SYSTEM_SUSPEND ) + { + epoint &=3D GENMASK(31, 0); + cid &=3D GENMASK(31, 0); + } + + perfc_incr(vpsci_system_suspend); + PSCI_SET_RESULT(regs, do_psci_1_0_system_suspend(epoint, cid)); + return true; + } + default: return false; } diff --git a/xen/common/domain.c b/xen/common/domain.c index ab910fcf93..c128074e7c 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1435,6 +1436,9 @@ void domain_resume(struct domain *d) spin_lock(&d->shutdown_lock); =20 d->is_shutting_down =3D d->is_shut_down =3D 0; + + arch_domain_resume(d); + d->shutdown_code =3D SHUTDOWN_CODE_INVALID; =20 for_each_vcpu ( d, v ) diff --git a/xen/include/xen/suspend.h b/xen/include/xen/suspend.h new file mode 100644 index 0000000000..c6ea7e867c --- /dev/null +++ b/xen/include/xen/suspend.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef XEN_SUSPEND_H +#define XEN_SUSPEND_H + +#if __has_include() +#include +#else +static inline void arch_domain_resume(struct domain *d) +{ + (void)d; +} +#endif + +#endif /* XEN_SUSPEND_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0 From nobody Fri Apr 3 10:20:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1774355360; cv=none; d=zohomail.com; s=zohoarc; b=Fbb3SsybOPK77Q/qsOuDq5GhRjg7hLBQbNgqHIALuc99vcwnOH9R8oimzBfG66VzgjsMmpRwdGCbdrnB5ZCJ6NwNCX+/3c0rOuVegOaXlj/sT3ELpOAa64FhDC3Fdasd/AozYztpqC2jECaJvHafnxc0J2kc3DvU1C8IaY+d30o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774355360; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SjKcgpgVhPtaCMEXLSjgtM5Jeo9qa3Adh6wKPCR5tAQ=; b=dBiMIRjfAW5RaLLc8I5kfJBeDRUsbXYv4qOlFn5YkbXxi3Q7CMgRaMR/+UK90SwFO77q1dnSTQoGZZgZVVciawW0Tc5lcB2N3sINnwzNLJCfH4007txvz8eV16PaoTxetR3RNgWbb3Ie8/3sFpZ2r6zuERqwQ3izJVqqM/ZFaLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774355360637839.4233318705578; Tue, 24 Mar 2026 05:29:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1260573.1553850 (Exim 4.92) (envelope-from ) id 1w50sU-00019S-MK; Tue, 24 Mar 2026 12:28:58 +0000 Received: by outflank-mailman (output) from mailman id 1260573.1553850; Tue, 24 Mar 2026 12:28:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sU-00019L-Je; Tue, 24 Mar 2026 12:28:58 +0000 Received: by outflank-mailman (input) for mailman id 1260573; Tue, 24 Mar 2026 12:28:57 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sT-0000iz-9U for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 12:28:57 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w50sS-00EGTP-L5 for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 13:28:56 +0100 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c2837f-e002-0a2a0a5209dd-0a2a450a8b58-34 for ; Tue, 24 Mar 2026 13:28:56 +0100 Received: from [209.85.218.44] (helo=mail-ej1-f44.google.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c28388-1772-0a2a450a0019-d155da2cd587-3 for ; Tue, 24 Mar 2026 13:28:56 +0100 Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b9358dd7f79so639828966b.1 for ; Tue, 24 Mar 2026 05:28:56 -0700 (PDT) Received: from EPUAKYIW02F7.. ([45.12.26.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9832f43ae8sm638180966b.6.2026.03.24.05.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 05:28:54 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774355336; x=1774960136; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SjKcgpgVhPtaCMEXLSjgtM5Jeo9qa3Adh6wKPCR5tAQ=; b=OXVmHXT4K9YA2DAVQHDFyR9U/jUAXr94idFXgjajE+SATmuszGQKKj1rGBZDfARCYQ COLm9DcJXM9EFGnFOIs+W54KRAfuwTOsO47naFR9MmU1eNf3r7Xvu4aoAorep/umI0xY 3HFe1Ziir4Z6YXcnjAnIiDRG8/Y+hfSkxgIZs4n7qSfMHXCi7WccLICmgqfcwq7diVGq mImWYAbnEBQsxrPNpDvocbxviHUwQOvfIMGqhESXW4benM1iCHYm0YGkHl8q1Jd5d1JV 4MMy54z6JQPV4Vz4cuAfbdej0HJwpBT13aoOUPf00uW1AaSFE9nUcMVh5TjvywnGKMCq +Oag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774355336; x=1774960136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SjKcgpgVhPtaCMEXLSjgtM5Jeo9qa3Adh6wKPCR5tAQ=; b=a/QRqXxl5TxY2jrydL9CnpIdvddjBWu0xWmpxao+1um9wql79cPa8yVxz71lHwhfdl nl+HqZ+uxbP/UnXUvph/C1wvqzM3iK9lhIeiLstNEMF/dOR9570oaonN0I90w5DJ9nhS agahnQ/RnjTG98v3BfahYbc4wPEqSDXNsL2s27lKyl6JTgKM7b4XY7Q8ZZCMoHZ54WtD ZeNbHns0v/todqwTTzywIfhcljJMIJvikLb8m4LMb/6n9N4/gE6rQRISChSlRDGbgSkC yVXfjO7VBXjWqW1luW/bhufuThNG3nQnul7bpRMg+Z9X55b63C+sCQ2xxcx8uhdnVwbk Fc6g== X-Gm-Message-State: AOJu0Yyj6+ZNUSyA/0ZLc9AMvnPghFlPunbScxPfXHYN9z7qplaBP8l2 hqgszEdgLacXppOFqnVSPq/Kssmry3rk5XVPAmdAh2zQYcxw2nTT5Pdnxj18XQ== X-Gm-Gg: ATEYQzymdni2j4chJwAz1Va4K29mIteqa+oe6MicuNkUa0JlDe/iSzgB0n4NqZ1U139 4hDs745ugjHThynAIqr+aaxkSHPTiNMPFXMW2G+SQ2xmRjeuq3dDJptziNsP/Y2Ha6Yh2Nve7Tw EWiLnCLFoTzbp7qCFs9weeLkSfgEFzttz9YHDdtWLvR8n/LG7ar1zleOsyQf2yPPatGdop7ygSw IVgmn19N4OwlKL9NVc4LyHc1Ms5IGk/TXH0WkpEBdTvoKNytjyvkFBZSXBtVFzTyPx++ap8j3D5 PYt4vDj8ZjRLekTkLO2QU26hr7VYjbKLMeyodkw6w9qn7vc9shltsZuGqNAr7VOyX/em81hQCvV QV5zI27H2FRz+rwarsYWvawIIo8fgjtNc0EiQTp85wiodT2ZT54FLnwsGVnKNJVuDRTZgzVUzh0 JXCLmnMJzOdPwOhEMgNYiGqslFLac= X-Received: by 2002:a17:906:1b17:b0:b97:91c0:fc3b with SMTP id a640c23a62f3a-b982f242b11mr1012744866b.16.1774355335307; Tue, 24 Mar 2026 05:28:55 -0700 (PDT) From: Mykola Kvach To: xen-devel@lists.xenproject.org Cc: Mykola Kvach , Anthony PERARD , Juergen Gross Subject: [PATCH v17 2/4] tools/xl: Allow compilation of 'xl resume' command on Arm Date: Tue, 24 Mar 2026 14:26:35 +0200 Message-ID: <6a9b083bf18c9eb388076ba71041452937d29b01.1774353053.git.mykola_kvach@epam.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-4011c0/1774355336-52892900-8588D33B/0/0 X-purgate-type: clean X-purgate-size: 4933 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1774355363603154100 Content-Type: text/plain; charset="utf-8" From: Mykola Kvach The "xl resume" command was previously excluded from Arm builds because system suspend/resume (e.g., SYSTEM_SUSPEND via vPSCI) was not implemented. On x86, this command is used for resume. This change enables compilation of `xl resume` on Arm regardless of the underlying implementation status, making the tool available for testing and future feature support. The relevant libxl infrastructure and handler functions are already present and usable. Note: This does not imply full system suspend/resume support on Arm. The `xl suspend` command still does not work on Arm platforms. Signed-off-by: Mykola Kvach Acked-by: Anthony PERARD --- Changes in v16: - no chnages --- 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 ++++++------ 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/include/libxl.h b/tools/include/libxl.h index bc35e412da..14b9e4a859 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -1145,7 +1145,6 @@ typedef struct libxl__ctx libxl_ctx; * restoring or migrating a domain. In this case the related functions * should be expected to return failure. That is: * - libxl_domain_suspend - * - libxl_domain_resume * - libxl_domain_remus_start */ #if defined(__arm__) || defined(__aarch64__) diff --git a/tools/xl/xl.h b/tools/xl/xl.h index 9000df00de..63db30a6eb 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -65,7 +65,7 @@ static const char migrate_permission_to_go[]=3D "domain is yours, you are cleared to unpause"; static const char migrate_report[]=3D "my copy unpause results are as follows"; -#endif +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ =20 /* followed by one byte: * 0: everything went well, domain is running @@ -130,8 +130,8 @@ int main_migrate_receive(int argc, char **argv); int main_save(int argc, char **argv); int main_migrate(int argc, char **argv); int main_suspend(int argc, char **argv); +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ int main_resume(int argc, char **argv); -#endif int main_dump_core(int argc, char **argv); int main_pause(int argc, char **argv); int main_unpause(int argc, char **argv); diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c index 06a0039718..bcb2d233cc 100644 --- a/tools/xl/xl_cmdtable.c +++ b/tools/xl/xl_cmdtable.c @@ -198,12 +198,12 @@ const struct cmd_spec cmd_table[] =3D { "Suspend a domain to RAM", "", }, +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ { "resume", &main_resume, 0, 1, "Resume a domain from RAM", "", }, -#endif { "dump-core", &main_dump_core, 0, 1, "Core dump a domain", @@ -548,7 +548,7 @@ const struct cmd_spec cmd_table[] =3D { " checkpoint must be disabled.\n" "-p Use COLO userspace proxy." }, -#endif +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ { "devd", &main_devd, 0, 1, "Daemon that listens for devices and launches backends", diff --git a/tools/xl/xl_migrate.c b/tools/xl/xl_migrate.c index b8594f44a5..4b4a379aa1 100644 --- a/tools/xl/xl_migrate.c +++ b/tools/xl/xl_migrate.c @@ -767,7 +767,7 @@ int main_remus(int argc, char **argv) close(send_fd); return EXIT_FAILURE; } -#endif +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ =20 =20 /* diff --git a/tools/xl/xl_saverestore.c b/tools/xl/xl_saverestore.c index 953d791d1a..747094ec7b 100644 --- a/tools/xl/xl_saverestore.c +++ b/tools/xl/xl_saverestore.c @@ -270,7 +270,7 @@ int main_save(int argc, char **argv) return EXIT_SUCCESS; } =20 -#endif /* LIBXL_HAVE_NO_SUSPEND_RESUME */ +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ =20 =20 =20 diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index c813732838..93766f631b 100644 --- a/tools/xl/xl_vmcontrol.c +++ b/tools/xl/xl_vmcontrol.c @@ -38,11 +38,6 @@ static void suspend_domain(uint32_t domid) libxl_domain_suspend_only(ctx, domid, NULL); } =20 -static void resume_domain(uint32_t domid) -{ - libxl_domain_resume(ctx, domid, 1, NULL); -} - int main_suspend(int argc, char **argv) { int opt; @@ -55,6 +50,12 @@ int main_suspend(int argc, char **argv) =20 return EXIT_SUCCESS; } +#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */ + +static void resume_domain(uint32_t domid) +{ + libxl_domain_resume(ctx, domid, 1, NULL); +} =20 int main_resume(int argc, char **argv) { @@ -68,7 +69,6 @@ int main_resume(int argc, char **argv) =20 return EXIT_SUCCESS; } -#endif =20 static void pause_domain(uint32_t domid) { --=20 2.43.0 From nobody Fri Apr 3 10:20:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1774355364; cv=none; d=zohomail.com; s=zohoarc; b=DiPtEM1oE5VGH2VuaEDqwX5eauDKapAsqjYKwC4X+whEEQnAXUzyq0Q9+PjOJRF5c9In6EjzuVrrge+F4Asboz7pLA9xWFbvzZAUfUjSPW/20QLiGIL012JxDV5vQySN10QKpfCbxWpJ+X4J86VxXzEXeKTL0HbNve5h+SldA74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774355364; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k/JxxBDY+KhwZWz0jMdNpGTqDW+EDXqjFu4woHI4vHE=; b=jeMklrwmRjFO+JIl1UQgkziGFZfYuwlimw6drjMORO0aQiHiuYB2PawcnvAl2Yk1cYL+yg2sGntJ8B2D3voxiYzyubuHLs8OnFEho/S5T/pCYx7A5gWoI9ITToOHzsF6xLZHobdgjYKHO5/0G7mgpQjPYkw6kafHKWnzF089qHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774355364307516.1062130693493; Tue, 24 Mar 2026 05:29:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1260574.1553855 (Exim 4.92) (envelope-from ) id 1w50sU-0001Cn-Ux; Tue, 24 Mar 2026 12:28:58 +0000 Received: by outflank-mailman (output) from mailman id 1260574.1553855; Tue, 24 Mar 2026 12:28:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sU-0001Ce-Qs; Tue, 24 Mar 2026 12:28:58 +0000 Received: by outflank-mailman (input) for mailman id 1260574; Tue, 24 Mar 2026 12:28:58 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sT-0000xN-V2 for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 12:28:57 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w50sR-008sjJ-PK for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 13:28:57 +0100 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c2837d-2eae-0a2a0a5409dd-0a2a450b9bd6-46 for ; Tue, 24 Mar 2026 13:28:57 +0100 Received: from [209.85.218.50] (helo=mail-ej1-f50.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c28389-ef63-0a2a450b0019-d155da32ac4f-3 for ; Tue, 24 Mar 2026 13:28:57 +0100 Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b976536806cso806493566b.0 for ; Tue, 24 Mar 2026 05:28:57 -0700 (PDT) Received: from EPUAKYIW02F7.. ([45.12.26.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9832f43ae8sm638180966b.6.2026.03.24.05.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 05:28:55 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774355336; x=1774960136; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k/JxxBDY+KhwZWz0jMdNpGTqDW+EDXqjFu4woHI4vHE=; b=WpyGNX4KmwLvpTw2licwsjp6bF/zcULaIuOXeJU+Hb3NsW/H9GTZu8xC5oWXG89jU9 zBqFsQsJ+9BZ06S9bE8DFoiEvPQkK69tDqAXhHHF8ksQa5WJQtWR5gKD69x0ssM3Jedd HrDL7aGxLVNARHHk4eyd5ia7/tIVpFNjVmDNFZvGOQy5bLWewj10l78T76Y9yp2vkgHD HzcXfiSZVLx+V3J1o0RNg6aZTYfO1rc2cZzMrU2GjZbisTYoyfgEY8h/yZP1udNS6MxT wdWgY32RvNjv3HJ5AGbBnDUVE7GoqU0zWI/QOUXUGHxpsx3gJGxDh97taB3TCRFhr4cQ FdlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774355336; x=1774960136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=k/JxxBDY+KhwZWz0jMdNpGTqDW+EDXqjFu4woHI4vHE=; b=g+zYilR7LtPKkr7Vnj0M7NFl1DeUKaTrVFikArz4oZBE8A5OpjSXay6Q+03Mp0zO+C fZHYJFZFvq/RdkgGcINjrvQVTVHkaYWWB59qtBPlvNx6J3VTqTy8PpzrU2v/kZQIa0Mg 22p6oAtvX9la40TGbn8eJ+McEy5LCQgqmtRpWEnXPc7R9kyfSIDanfLhBaykhd80xSqK ge9GGGf7ewUmaVuZJIn4xvJFif7GfclhZDfsQT7CATJD8jioVIYxOdaD8KoNgAUq4LPx PUVJ1SkgAluWWVsqjg7fVH2kwOsQEvLRdLGnvugfsCmM/xq0hqrp2vpxvSz/pfXQAYEE c3Dg== X-Gm-Message-State: AOJu0YxtNbvLwW5eFMWc//BYD08x7eLHUBwuIPYlN/nYPRnTPNjn8DQt 7q+dsx9r8oFi58+Sh4Dp1DTR+Qs0UCPxWS7W+q7jKxbMJsAhXhxeafMMXlUL9w== X-Gm-Gg: ATEYQzwuI5p0JWJm7Xi1vMixdnVCV66Hq+Lp+GGso9X7Q9l7VOdfRNBsdI8RWao26BO sn/oV4xgcEhQsqMSlq2viuF+pOAw+2fFI7piMmLnArPEiubVHwktmAX87HyQIkpIlsDbEO/jqLH st+bXQPGe+JF0Z4Ytad8gef9FfZ2AGIU21zlaowWKBFMEl8IKyMIjtyWOQ/WLDpHlQCGEnZdDez UIZVywfYCwAVa70uQ3//nhYQLncCq8R3MSPtQzvqQJYHQLmehFwhRPCyk5gYNFLvQXulx2uHoNy DRrRUq8Uf3ydesrBZ9kQGF4a+xo+Edjej7jC9eEqroeyZE40B2B3Es2jy9cjovqpEdNnVsR44pR ZDcl8dVwXn5PVdk1RU5l/j+zPdlSyt130Opvg5RGeYYtitACrvSNMpsAxe7ctG3k7hOnXBgHQcn cPrBCP65dnhr+VhO+1BO5dA7D7tTVBjSdXnpcoIg== X-Received: by 2002:a17:906:6d0:b0:b98:da3:5132 with SMTP id a640c23a62f3a-b982f39a06emr859844766b.37.1774355336254; Tue, 24 Mar 2026 05:28:56 -0700 (PDT) From: Mykola Kvach To: xen-devel@lists.xenproject.org Cc: Mykola Kvach , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Julien Grall Subject: [PATCH v17 3/4] SUPPORT.md: Document PSCI SYSTEM_SUSPEND support for guests Date: Tue, 24 Mar 2026 14:26:36 +0200 Message-ID: <0ae34dacecf7268f76750f2d07982a461375f3f7.1774353053.git.mykola_kvach@epam.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1774355337-9B8A5112-3FAB27CF/0/0 X-purgate-type: clean X-purgate-size: 1154 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1774355364921158500 Content-Type: text/plain; charset="utf-8" From: Mykola Kvach Add a new entry under the "Virtual Hardware, Hypervisor" section documenting support for the optional PSCI SYSTEM_SUSPEND function exposed to guests. This function is available via the virtual PSCI interface and allows guest domains (domUs) to initiate system suspend operations. The feature is currently marked as "Tech Preview". Signed-off-by: Mykola Kvach Acked-by: Julien Grall --- Changes in V16: - no changes. --- SUPPORT.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index d441bccf37..8e7ab7cb3e 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -962,8 +962,9 @@ Emulated PSCI interface exposed to guests. We support a= ll mandatory functions of PSCI 1.1. See below for the list of optional PSCI call implemented and their status. =20 - Status, Mandatory: Supported - Status, MIGRATE_INFO_TYPE: Supported + Status, Mandatory: Supported + Status, MIGRATE_INFO_TYPE: Supported + Status, SYSTEM_SUSPEND: Tech Preview =20 ## Virtual Hardware, QEMU =20 --=20 2.43.0 From nobody Fri Apr 3 10:20:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1774355361; cv=none; d=zohomail.com; s=zohoarc; b=RpV/dd7pb+5V6jba+9T1jAf8ohYFWOS9xQMpTm1uA+v3ZelOu9YAe55RR3Enoh2YI/B4U25wAKODwonzStEplZILZFfH6x2ETk1510FPvOSJ1s8OKsxn6UubfllT7LKvvL1Yqns5X4r4T9XLUSTeobD9Ss9Yi+4blmGs8s6j92U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774355361; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5V7qWNxkL9fZedO5saDR1Yh4qFPCnis+jo0Tf2NZuMI=; b=g1z1NsSBVG0A5dDGqKjTfsKI0mvptEj5BJXo98u6uGETG6I9e5HS1svlNV/uDymheZyaX1CFH5w+VeBa0IJAHDhIlo57tzBp2urZhoPGQX+vfx2pyV4cXxq6ro6YxxND6cUQoXy40RI6pI7HBdyoddOSbf2EebpCbSgBrXJgYvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774355361717380.2126184781829; Tue, 24 Mar 2026 05:29:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1260575.1553868 (Exim 4.92) (envelope-from ) id 1w50sW-0001bD-6S; Tue, 24 Mar 2026 12:29:00 +0000 Received: by outflank-mailman (output) from mailman id 1260575.1553868; Tue, 24 Mar 2026 12:29:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sW-0001b3-1j; Tue, 24 Mar 2026 12:29:00 +0000 Received: by outflank-mailman (input) for mailman id 1260575; Tue, 24 Mar 2026 12:28:59 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w50sU-00019p-Tk for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 12:28:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w50sS-008sjJ-OI for xen-devel@lists.xenproject.org; Tue, 24 Mar 2026 13:28:58 +0100 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c2838a-2eae-0a2a0a5409dd-0a2a4505c54c-0 for ; Tue, 24 Mar 2026 13:28:58 +0100 Received: from [209.85.208.46] (helo=mail-ed1-f46.google.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c28389-5aeb-0a2a45050019-d155d02ea8eb-3 for ; Tue, 24 Mar 2026 13:28:58 +0100 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-6674cba2c50so9103754a12.0 for ; Tue, 24 Mar 2026 05:28:57 -0700 (PDT) Received: from EPUAKYIW02F7.. ([45.12.26.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9832f43ae8sm638180966b.6.2026.03.24.05.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 05:28:56 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774355337; x=1774960137; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5V7qWNxkL9fZedO5saDR1Yh4qFPCnis+jo0Tf2NZuMI=; b=kOOq+vFkKaC9HDer4DydvEmQ78WUJLiGRsL9+cj4iW5QU70lYrDakgPjYN8dtazrQj zhQn1XU6ELMGtyEyogKvIV7FTKKZbhtsdHqIk2gk+FrhZDofXHojZVcxOBaEhZY8maE5 8s6+/UThOtDtaSZCUKuAkzI1LUloXpNf938qF+c05gHx0ZoGpJ7Fp3syXoTB63LakAX0 mD3oKpLSSkSCvgWSYLDki4Jbhona1QdfHAPbr63vyCj4eyHsUoD5pEXFPpj5KOihjEO6 nG023jt7bR67Txssxw8c1EFXHT0j2AVl8DGsqFn3u6U7J5/1vzqzACGUv4dxTyCFT0HJ 7yEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774355337; x=1774960137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5V7qWNxkL9fZedO5saDR1Yh4qFPCnis+jo0Tf2NZuMI=; b=RdTqKX64VBbfKGK/cRKYaNGbb6GHfMujEFppv1kN9+GPizS1oR03WEXLliUDhVr2SR WgLbIlKcntFr+mh+VlMXeiXnd4YFZOGbp1WxBCAZgwCBQb9/xNleRqWOVn3QdJ/HtPn7 AgBa+zmBVjiJdNKuH+yNWOu7m0jE8zAdA2w4fGhDwfWwRLdFUjgzw9vjCQKNL/ET3+Uj QlChFVB4vrK8CTDEmudfh34vWtnCLzBXyBMiXUuAfOvFAX6JenHDjpFceaO9ONxlsg4Y n3FMkSO1jBPbqmUINUWJHyDPyXNNpbrPHBXgCNsha7bzpbM/cK6LWC2tBu2httk6big3 7RxQ== X-Gm-Message-State: AOJu0YxI3jLMUWzKhFxy2DcNmowDUyp7zDO4qtSopTGVZTyzrXIeVrxI bogsMTzKHN7qIcNa9nZ6bfwDKBldF0VOw+nLRcizmdB4/Uv7xAvq+6K0dzTfbg== X-Gm-Gg: ATEYQzy+u34JJ0BwaQmmZNd/RTRc9V5PXy3CcP1oCIGlAttpdqxmCZcrLWtmSwhaD/V dttB4wTdjSjbuiyvrSXiWSP5O2t1rmsbtDraxUv6Sucfi8bNydduC/MKbBxdOGEYrJL0cRSTTiH RsQ3iE4S0OSWtFoOTk+ddfNm/cfdWD5G4WUddJCFGG2Lj3sj2eQUWJQe++1XZ59Y+OdHUGxq2XN nxUKjoN2nFnOSucLAIXEC4scmX6fsPONahbJuKSluC8mu6K75s47M7PMQZObfv27ArB9yMGZ0+4 HX8XxrKv0uicmIy1tDxZklrzhI6Nlylg+sSomqAJODgrRb7qw6XfLzyptttfwdkxJ7xOjJ9DFSh kS+skrwonTF8q5JceDEyweWs/Y+6ja90+NZJLUJSy4bGEzD37jIa+BIg3s0BjOSkhlQ5EyxKbfc gbv0axM6yd3JiajirB/a6JCPlh78o= X-Received: by 2002:a17:907:97ce:b0:b97:f2cc:8c3e with SMTP id a640c23a62f3a-b98863728fbmr256741866b.10.1774355337010; Tue, 24 Mar 2026 05:28:57 -0700 (PDT) From: Mykola Kvach To: xen-devel@lists.xenproject.org Cc: Mykola Kvach , Oleksii Kurochko , Community Manager Subject: [PATCH v17 4/4] CHANGELOG: Document guest suspend/resume to RAM support on Arm Date: Tue, 24 Mar 2026 14:26:37 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-c201ff/1774355338-8295A488-32A53ED7/0/0 X-purgate-type: clean X-purgate-size: 1014 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1774355363260158500 Content-Type: text/plain; charset="utf-8" From: Mykola Kvach Mention the newly added support for guest suspend and resume to/from RAM via vPSCI on Arm platforms. This support is limited to non-hardware domain guests. Signed-off-by: Mykola Kvach Acked-by: Oleksii Kurochko --- Changes in v16: - cosmetic changes after review. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c191e504ab..eab73f28d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ The format is based on [Keep a Changelog](https://keepac= hangelog.com/en/1.0.0/) misusing atomic instructions. - Support for CPIO microcode in discrete multiboot modules. =20 + - On Arm: + - Support for guest suspend and resume to/from RAM via vPSCI. + Applies only to non-hardware domain guests. + ### Removed - On x86: - The cpuid_mask_* command line options for legacy CPUs. These were --=20 2.43.0