[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v12 11/13] xen/arm: Implement PSCI SYSTEM_SUSPEND call (host interface)


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Wed, 30 Sep 2026 20:32:17 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pmBYNh3PS2m2gzLvQrL8S0YUAofKXv9LimmpW1HR1M8=; fh=Mq2lEHVOM/J/Dg3lqY0fDKPlajmc/jSeJ0FT5CSZSe8=; b=cazCGlhSlsnTgRth91QyHoIKnY0A5rL+YXI+s9pIY1/18oiQBQPX+whopfP1dP9BdM dF6weGlYv1SBtL+7+7hzegv8fwrERyRso+r3lvonvXBW23cWXiFEnQZYn3xOEn8+UMcw dy+BySeyhukPKjymfMvO6NlkGxn4SuoTl7ILVUsys6wS3MZJVS7Hga0cZz2pMfAg9idW NHHoWlLejH6ilDHEcuG84x5KuN8SAPqup2vZVFQptXBQ7ZGGGWZoarseQIVkSpAfqwwg rqFCz2od7Ew3Cmvg1cexM72fX4Wjf0JXfX2kiE5PocSY7SH7rkK8SOLra2GPu08l84b/ mAVg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1790789549; cv=none; d=google.com; s=arc-20260327; b=F8axNFfl8RODKXyJWAXKOdhHAtE3423cFZ9MYY5YAAYLnKx9ZiptBIZirxJ3vHpAPr 0l0eUVPu5IaGHQ8b47oz+1hOzlTMRlneE4sor3xPMxzeeEP+AfPqq9R6k1hnCI6mb0tD bjGYWnIe4iFXOQf8pq5TSszE4c6f7bMrFoiQzgMx9MEDwYE/Ubqy/auuTB8v/zJoqSft NYXJmFIcidtZ1H0T6jgQwwju/ybfjE0k7da72NIhOsqonSys5tyFb4gpS6D1TxU544TD Jsa95JCWDyDbDu54Lh3blrF+tr3YsbgNMQpNsRjH+yH7MT2SuiQFbVV9pcyTFnhVEqWP VH/w==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: Mykola Kvach <mykola_kvach@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Delivery-date: Wed, 30 Sep 2026 17:32:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Sep 28, 2026 at 7:19 PM Bertrand Marquis
<Bertrand.Marquis@xxxxxxx> wrote:
>
> Hi Mykola,
>
> > On 27 Aug 2026, at 16:31, Mykola Kvach <mykola_kvach@xxxxxxxx> wrote:
> >
> > From: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
> >
> > Invoke PSCI SYSTEM_SUSPEND to finalize Xen's suspend sequence on ARM64
> > platforms. Pass the Xen resume entry point (hyp_resume) to EL3 together
> > with a zero context ID, matching Linux.
> >
> > This patch wires up only the host-side PSCI SYSTEM_SUSPEND invocation.
> > The resume trampoline and context restore are provided by earlier patches
> > in the series.
> >
> > Only enable this path when CONFIG_SYSTEM_SUSPEND is set and PSCI
> > advertises SYSTEM_SUSPEND via PSCI_FEATURES.
> >
> > Signed-off-by: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>
> > Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xxxxxxxxxx>
> > Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
> > Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> > Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> > ---
> > Changes in v9:
> > - cache SYSTEM_SUSPEND support using PSCI_FEATURES and gate the host call
> >  on the cached capability
> > - keep the cached SYSTEM_SUSPEND capability read-only after init
> > - log whether firmware reports SYSTEM_SUSPEND support
> > - pass an explicit zero context ID in the SYSTEM_SUSPEND call
> > - drop the stale note claiming hyp_resume is still a stub
> > ---
> > xen/arch/arm/include/asm/psci.h |  1 +
> > xen/arch/arm/psci.c             | 31 ++++++++++++++++++++++++++++++-
> > 2 files changed, 31 insertions(+), 1 deletion(-)
> >
> > diff --git a/xen/arch/arm/include/asm/psci.h 
> > b/xen/arch/arm/include/asm/psci.h
> > index 48a93e6b79..bb3c73496e 100644
> > --- a/xen/arch/arm/include/asm/psci.h
> > +++ b/xen/arch/arm/include/asm/psci.h
> > @@ -23,6 +23,7 @@ int call_psci_cpu_on(int cpu);
> > void call_psci_cpu_off(void);
> > void call_psci_system_off(void);
> > void call_psci_system_reset(void);
> > +int call_psci_system_suspend(void);
> >
> > /* Range of allocated PSCI function numbers */
> > #define PSCI_FNUM_MIN_VALUE                 _AC(0,U)
> > diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> > index b6860a7760..e05dae1133 100644
> > --- a/xen/arch/arm/psci.c
> > +++ b/xen/arch/arm/psci.c
> > @@ -17,23 +17,27 @@
> > #include <asm/cpufeature.h>
> > #include <asm/psci.h>
> > #include <asm/acpi.h>
> > +#include <asm/suspend.h>
> >
> > /*
> >  * While a 64-bit OS can make calls with SMC32 calling conventions, for
> >  * some calls it is necessary to use SMC64 to pass or return 64-bit values.
> > - * For such calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate
> > + * For such calls PSCI_*_FN_NATIVE(x) will choose the appropriate
> >  * (native-width) function ID.
> >  */
> > #ifdef CONFIG_ARM_64
> > #define PSCI_0_2_FN_NATIVE(name)    PSCI_0_2_FN64_##name
> > +#define PSCI_1_0_FN_NATIVE(name)    PSCI_1_0_FN64_##name
> > #else
> > #define PSCI_0_2_FN_NATIVE(name)    PSCI_0_2_FN32_##name
> > +#define PSCI_1_0_FN_NATIVE(name)    PSCI_1_0_FN32_##name
> > #endif
> >
> > uint32_t psci_ver;
> > uint32_t smccc_ver;
> >
> > static uint32_t psci_cpu_on_nr;
> > +static bool __ro_after_init has_psci_system_suspend;
> >
> > #define PSCI_RET(res)   ((int32_t)(res).a0)
> >
> > @@ -60,6 +64,25 @@ void call_psci_cpu_off(void)
> >     }
> > }
> >
> > +int call_psci_system_suspend(void)
> > +{
> > +#ifdef CONFIG_SYSTEM_SUSPEND
> > +    struct arm_smccc_res res;
> > +
> > +    if ( !has_psci_system_suspend )
> > +        return PSCI_NOT_SUPPORTED;
> > +
> > +    /* Context ID is unused for the Xen resume path. */
> > +    arm_smccc_smc(PSCI_1_0_FN_NATIVE(SYSTEM_SUSPEND), __pa(hyp_resume), 0,
> > +                  &res);
>
> Since this series was sent, arm_smccc_smc() has been changed to return
> the result directly instead of writing it through a result pointer.
>
> You need to update this call.

Ack.

Best regards,
Mykola



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.