All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mirela Simonovic <mirela.simonovic@aggios.com>
To: Xen Devel <xen-devel@lists.xen.org>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Tim Deegan <tim@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>, Davorin Mista <dm@aggios.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Saeed Nowshadi <saeed.nowshadi@xilinx.com>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: Re: [PATCH 00/18] xen/arm64: Suspend to RAM support for Xen
Date: Mon, 12 Nov 2018 12:37:53 +0100	[thread overview]
Message-ID: <CAKPH-NjmaZENb8gT=+FobrAycRF01_--6GuRA2ck9Di5wiudhA@mail.gmail.com> (raw)
In-Reply-To: <1542022244-22977-1-git-send-email-mirela.simonovic@aggios.com>


[-- Attachment #1.1: Type: text/plain, Size: 7629 bytes --]

Hi,

One thing I screwed - I forgot to remove changes log from an internal
review, so please ignore it. This is officially the first version.

Thanks,
Mirela

On Mon, Nov 12, 2018 at 12:31 PM Mirela Simonovic <
mirela.simonovic@aggios.com> wrote:

> This series contains support for suspend to RAM (in the following text just
> 'suspend') for Xen on arm64. The implementation is aligned with the design
> specification that has been proposed on xen-devel list:
> https://lists.xenproject.org/archives/html/xen-devel/2017-12/msg01574.html
>
> At a high-level the series contains:
> 1) Support for suspending guests via virtual PSCI SYSTEM_SUSPEND call
> 2) Support for resuming a guest on an interrupt targeted to that guest
> 3) Support for suspending Xen after dom0 finalizes the suspend
> 4) Support for resuming Xen on an interrupt that is targeted to a guest
>
>
> --------------------------------------------------------------------------------
> In more details:
>
> *** About suspending/resuming guests
>
> The patches included in this series allow PSCI compliant guests that have
> support for suspend to RAM (e.g. echo mem > /sys/power/state in Linux) to
> suspend and resume on top of Xen without any EL1 code changes.
>
> During their suspend procedure guests will hot-unplug their secondary CPUs,
> triggering Xen's virtual CPU_OFF PSCI implementation, and then finalize the
> suspend from their boot CPU, triggering Xen's virtual SYSTEM_SUSPEND PSCI.
> Guests will save/restore their own EL1 context on suspend/resume.
>
> A guest is expected to leave enabled interrupts that are considered to be
> its
> wake-up sources. Those interrupts will be able to wake up the guest. This
> holds
> regardless of the state of the underlying software layers, i.e. whether
> Xen gets
> suspended or not doesn't affect the ability of the guest to wake up.
>
> First argument of SYSTEM_SUSPEND PSCI call is a resume entry point, from
> which
> the guest assumes to start on resume. On resume, guests assume to be
> running in
> an environment whose state matches the CPU state after reset, e.g. with
> reset
> register values, MMU disabled, etc. To ensure this, Xen has to 'reset' the
> VCPU context and save the resume entry point into program counter before
> the
> guest's VCPU gets scheduled in on resume. This is done when the guest
> finalizes
> its suspend by calling PSCI SYSTEM_SUSPEND. In addition, we need to ensure
> that
> the resume-ready VCPU's context does not get overwritten later upon the
> context
> switch when the VCPU is scheduled out.
> Xen also needs to take care that the guest's view of GIC and timer gets
> saved.
> Also, while a guest is suspended its watchdogs are paused, in order to
> avoid
> watchdog triggered shutdown of a guest that has been asleep for a period
> of time
> that is longer than the watchdog period.
>
> After this point, from Xen's point of view a suspended guest has one VCPU
> blocked, waiting for an interrupt. When such an interrupt comes, Xen will
> unblock the VCPU of the suspended domain, which results in the guest
> resuming.
>
> *** About suspending/resuming Xen
>
> Xen starts its own suspend procedure once dom0 is suspended. Dom0 is
> considered to be the decision maker for EL1 and EL2.
> On suspend, Xen will first freeze all domains. Then, Xen disables physical
> secondary CPUs, which leads to physical CPU_OFF to be called by each
> secondary
> CPU. After that Xen finalizes the suspend from the boot CPU.
>
> This consists of suspending the timer, i.e. suppressing its interrupts (we
> don't
> want to be woken up by a timer, there is no VCPU ready to be scheduled).
> Then
> the state of GIC is saved, console is suspended, and CPU context is saved.
> The
> saved context tells where Xen needs to continue execution on resume.
> Since Xen will resume with MMU disabled, the first thing to do in resume
> is to
> resume memory management in order to be able to access the context that
> needs to
> be restored (we know virtual address of the context data). Finally Xen
> calls
> SYSTEM_SUSPEND PSCI to the EL3.
>
> When resuming, all the steps done in suspend need to be reverted. This is
> completed by unblocking dom0's VCPU, because we always want the dom0 to
> resume,
> regardless of the target domain whose interrupt woke up Xen.
>
> *** Handling of unprivileged guests during Xen suspend/resume
>
> Any domU that is not suspended when dom0 suspends will be frozen, domUs
> that are
> already suspended remain suspended. On resume the suspended domUs still
> remain
> suspended (unless their wake interrupt caused Xen to wake) while the
> others will
> be thawed.
>
> For more details please refer to patches or the design specification:
> https://lists.xenproject.org/archives/html/xen-devel/2017-12/msg01574.html
>
>
> --------------------------------------------------------------------------------
> The series does not include:
> a) UART driver-specific suspend/resume that gets called when console
> suspends
> b) SMMU suspend/resume
> c) Suspend coordination support that would allow dom0 to request domUs to
> suspend
> These will be submitted in the following series.
>
> Mirela Simonovic (16):
>   xen/arm: Implement PSCI system suspend call (virtual interface)
>   xen/arm: Save GIC and virtual timer context when the domain suspends
>   xen/arm: While a domain is suspended put its watchdogs on pause
>   xen/arm: Trigger Xen suspend when Dom0 completes suspend
>   xen/x86: Move freeze/thaw_domains into common files
>   xen/arm: Freeze domains on suspend and thaw them on resume
>   xen/arm: Disable/enable non-boot physical CPUs on suspend/resume
>   xen/arm: Add rcu_barrier() before enabling non-boot CPUs on resume
>   xen/arm: Implement GIC suspend/resume functions (gicv2 only)
>   xen/arm: Suspend/resume GIC on system suspend/resume
>   xen/arm: Suspend/resume timer interrupt generation
>   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
>   xen/arm: Resume Dom0 after Xen resumes
>   xen/arm: Suspend/resume console on Xen suspend/resume
>
> Saeed Nowshadi (2):
>   xen/arm: Move code that initializes VCPU context into a separate
>     function
>   xen/arm: Convert setting MMU page tables code into a routine
>
>  xen/arch/arm/Makefile            |   1 +
>  xen/arch/arm/arm64/entry.S       | 178 ++++++++++++++++++++++++
>  xen/arch/arm/arm64/head.S        | 265 ++++++++++++++++++-----------------
>  xen/arch/arm/domain.c            |  62 ++++++---
>  xen/arch/arm/gic-v2.c            | 147 ++++++++++++++++++++
>  xen/arch/arm/gic.c               |  27 ++++
>  xen/arch/arm/mm.c                |   1 +
>  xen/arch/arm/psci.c              |  16 +++
>  xen/arch/arm/suspend.c           | 292
> +++++++++++++++++++++++++++++++++++++++
>  xen/arch/arm/time.c              |  22 +++
>  xen/arch/arm/vpsci.c             |  19 +++
>  xen/arch/x86/acpi/power.c        |  28 ----
>  xen/common/domain.c              |  29 ++++
>  xen/common/schedule.c            |  38 +++++
>  xen/include/asm-arm/gic.h        |   8 ++
>  xen/include/asm-arm/perfc_defn.h |   1 +
>  xen/include/asm-arm/psci.h       |   3 +
>  xen/include/asm-arm/suspend.h    |  39 ++++++
>  xen/include/asm-arm/time.h       |   3 +
>  xen/include/xen/domain.h         |   1 +
>  xen/include/xen/sched.h          |  11 ++
>  xen/include/xen/timer.h          |   3 +
>  22 files changed, 1019 insertions(+), 175 deletions(-)
>  create mode 100644 xen/arch/arm/suspend.c
>  create mode 100644 xen/include/asm-arm/suspend.h
>
> --
> 2.13.0
>
>

[-- Attachment #1.2: Type: text/html, Size: 8799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-11-12 11:38 UTC|newest]

Thread overview: 153+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 11:30 [PATCH 00/18] xen/arm64: Suspend to RAM support for Xen Mirela Simonovic
2018-11-12 11:30 ` [PATCH 01/18] xen/arm: Move code that initializes VCPU context into a separate function Mirela Simonovic
2018-11-12 11:41   ` Jan Beulich
2018-11-12 11:43   ` Wei Liu
2018-11-12 13:15   ` Julien Grall
2018-11-14 11:45     ` Mirela Simonovic
2018-11-12 11:30 ` [PATCH 02/18] xen/arm: Implement PSCI system suspend call (virtual interface) Mirela Simonovic
2018-11-12 11:42   ` Jan Beulich
2018-11-12 11:50     ` Mirela Simonovic
2018-11-12 12:45       ` Jan Beulich
2018-11-12 15:27   ` Julien Grall
2018-11-12 16:35     ` Mirela Simonovic
2018-11-12 16:41       ` Andrew Cooper
2018-11-12 19:56         ` Julien Grall
2018-11-13  8:32           ` Andrew Cooper
2018-11-14 12:08             ` Mirela Simonovic
2018-11-14 12:49               ` Julien Grall
2018-11-15  0:47                 ` Andrew Cooper
2018-11-15 10:13                   ` Julien Grall
2018-11-15 10:26                     ` Andrew Cooper
2018-11-15 10:33                       ` Mirela Simonovic
2018-11-15 10:59                         ` Julien Grall
2018-11-15 11:10                           ` Mirela Simonovic
2018-11-15 11:38                             ` Julien Grall
2018-11-15 11:42                               ` Mirela Simonovic
2018-11-15 19:30                                 ` Stefano Stabellini
2018-11-15 20:25                                 ` Julien Grall
2018-11-16 22:10                               ` Dario Faggioli
2018-11-15 10:36                       ` Julien Grall
2018-11-15 10:36                       ` Julien Grall
2018-11-15 10:50                         ` Andrew Cooper
2018-11-13  1:53         ` Stefano Stabellini
2018-11-13  9:41           ` Julien Grall
2018-11-13 20:39             ` Stefano Stabellini
2018-11-14 13:10               ` Julien Grall
2018-11-14 23:08                 ` Stefano Stabellini
2018-11-12 20:29       ` Julien Grall
2018-11-13 20:39         ` Stefano Stabellini
2018-11-14 10:45           ` Julien Grall
2018-11-14 12:35             ` Mirela Simonovic
2018-11-14 13:05               ` Julien Grall
2018-11-14 14:48                 ` Julien Grall
2018-11-14 15:36                   ` Mirela Simonovic
2018-11-14 15:37                     ` Mirela Simonovic
2018-11-14 15:51                     ` Julien Grall
2018-11-13 10:23   ` Julien Grall
2018-11-13 15:09     ` Julien Grall
2018-11-14 12:44       ` Mirela Simonovic
2018-11-12 11:30 ` [PATCH 03/18] xen/arm: Save GIC and virtual timer context when the domain suspends Mirela Simonovic
2018-11-12 15:36   ` Julien Grall
2018-11-12 16:52     ` Mirela Simonovic
2018-11-12 17:00       ` Julien Grall
2018-11-12 17:42         ` Mirela Simonovic
2018-11-12 19:20           ` Julien Grall
2018-11-13 20:44             ` Stefano Stabellini
2018-11-14 10:48               ` Julien Grall
2018-11-14 22:45                 ` Stefano Stabellini
2018-11-14 23:39                   ` Julien Grall
2018-11-15  0:05                     ` Julien Grall
2018-11-15  0:35                     ` Stefano Stabellini
2018-11-15 20:29                       ` Julien Grall
2018-11-12 11:30 ` [PATCH 04/18] xen/arm: While a domain is suspended put its watchdogs on pause Mirela Simonovic
2018-11-12 11:47   ` Jan Beulich
2018-11-12 15:17     ` Mirela Simonovic
2018-11-12 15:23       ` Jan Beulich
2018-11-12 15:31         ` Mirela Simonovic
2018-11-12 15:33           ` Andrew Cooper
2018-11-16 22:40             ` Dario Faggioli
2018-11-12 11:30 ` [PATCH 05/18] xen/arm: Trigger Xen suspend when Dom0 completes suspend Mirela Simonovic
2018-11-12 15:45   ` Julien Grall
2018-11-12 23:46     ` Stefano Stabellini
2018-11-13  9:43       ` Julien Grall
2018-11-13 11:26         ` Mirela Simonovic
2018-11-13 11:42           ` Julien Grall
2018-11-14 15:07   ` Julien Grall
2018-11-14 15:40     ` Mirela Simonovic
2018-11-14 17:10       ` Julien Grall
2018-11-14 17:35         ` Mirela Simonovic
2018-11-14 18:48           ` Julien Grall
2018-11-15 12:37             ` Mirela Simonovic
2018-11-15 18:23   ` Julien Grall
2018-11-15 19:17     ` Mirela Simonovic
2018-11-15 20:47       ` Julien Grall
2018-11-12 11:30 ` [PATCH 06/18] xen/x86: Move freeze/thaw_domains into common files Mirela Simonovic
2018-11-13 22:37   ` Stefano Stabellini
2018-11-12 11:30 ` [PATCH 07/18] xen/arm: Freeze domains on suspend and thaw them on resume Mirela Simonovic
2018-11-12 11:30 ` [PATCH 08/18] xen/arm: Disable/enable non-boot physical CPUs on suspend/resume Mirela Simonovic
2018-11-13 22:35   ` Stefano Stabellini
2018-11-14 12:07     ` Julien Grall
2018-11-14 10:52   ` Julien Grall
2018-11-14 13:00     ` Mirela Simonovic
2018-11-14 13:18       ` Julien Grall
2018-11-14 23:04         ` Stefano Stabellini
2018-11-14 23:45           ` Julien Grall
2018-11-15 18:57             ` Stefano Stabellini
2018-11-15 21:09               ` Julien Grall
2018-11-12 11:30 ` [PATCH 09/18] xen/arm: Add rcu_barrier() before enabling non-boot CPUs on resume Mirela Simonovic
2018-11-13 22:42   ` Stefano Stabellini
2018-11-14 12:11   ` Julien Grall
2018-11-14 22:29     ` Stefano Stabellini
2018-11-12 11:30 ` [PATCH 10/18] xen/arm: Implement GIC suspend/resume functions (gicv2 only) Mirela Simonovic
2018-11-13 23:41   ` Stefano Stabellini
2018-11-14  9:13     ` Julien Grall
2018-11-14 11:57       ` Mirela Simonovic
2018-11-14 12:41   ` Julien Grall
2018-11-14 12:52     ` Mirela Simonovic
2018-11-14 13:24       ` Julien Grall
2018-11-14 22:18         ` Stefano Stabellini
2018-11-14 23:50           ` Julien Grall
2018-11-15 18:26             ` Stefano Stabellini
2018-11-12 11:30 ` [PATCH 11/18] xen/arm: Suspend/resume GIC on system suspend/resume Mirela Simonovic
2018-11-12 11:30 ` [PATCH 12/18] xen/arm: Suspend/resume timer interrupt generation Mirela Simonovic
2018-11-12 11:30 ` [PATCH 13/18] xen/arm: Implement PSCI SYSTEM_SUSPEND call (physical interface) Mirela Simonovic
2018-11-14  0:14   ` Stefano Stabellini
2018-11-14 12:03     ` Mirela Simonovic
2018-11-15 21:20   ` Julien Grall
2018-11-12 11:30 ` [PATCH 14/18] xen/arm: Convert setting MMU page tables code into a routine Mirela Simonovic
2018-11-12 11:30 ` [PATCH 15/18] xen/arm: Resume memory management on Xen resume Mirela Simonovic
2018-11-12 16:17   ` Julien Grall
2018-11-13  1:36     ` Stefano Stabellini
2018-11-13  9:59       ` Julien Grall
2018-11-13 21:35         ` Stefano Stabellini
2018-11-13 22:24           ` Julien Grall
2018-11-12 11:30 ` [PATCH 16/18] xen/arm: Save/restore context on suspend/resume Mirela Simonovic
2018-11-12 11:30 ` [PATCH 17/18] xen/arm: Resume Dom0 after Xen resumes Mirela Simonovic
2018-11-15 20:31   ` Julien Grall
2018-11-16 10:33     ` Mirela Simonovic
2018-11-16 11:29       ` Mirela Simonovic
2018-11-16 11:44         ` Julien Grall
2018-11-16 12:34           ` Mirela Simonovic
2018-11-16 13:24             ` Julien Grall
2018-11-16 19:03               ` Stefano Stabellini
2018-11-16 19:09                 ` Stefano Stabellini
2018-11-16 21:41                   ` Mirela Simonovic
2018-11-16 21:58                     ` Julien Grall
2018-11-16 23:01                       ` Dario Faggioli
2018-11-16 23:06                         ` Stefano Stabellini
2018-11-17 16:01                           ` Mirela Simonovic
2018-11-17 16:02                             ` Mirela Simonovic
2018-11-17 16:19                               ` Mirela Simonovic
2018-11-27 18:36                             ` Julien Grall
2018-11-29 14:02                               ` Mirela Simonovic
2018-12-04 18:15                                 ` Julien Grall
2018-11-12 11:30 ` [PATCH 18/18] xen/arm: Suspend/resume console on Xen suspend/resume Mirela Simonovic
2018-11-27 18:46   ` Julien Grall
2018-11-12 11:37 ` Mirela Simonovic [this message]
2018-11-12 11:49 ` [PATCH 00/18] xen/arm64: Suspend to RAM support for Xen Julien Grall
2018-11-12 12:01   ` Mirela Simonovic
2018-11-12 12:08     ` Julien Grall
2018-11-12 12:35       ` Mirela Simonovic
2018-11-13  2:22   ` Stefano Stabellini
2018-11-13 10:02     ` Julien Grall
2018-11-13 18:06       ` Stefano Stabellini

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='CAKPH-NjmaZENb8gT=+FobrAycRF01_--6GuRA2ck9Di5wiudhA@mail.gmail.com' \
    --to=mirela.simonovic@aggios.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dfaggioli@suse.com \
    --cc=dm@aggios.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=saeed.nowshadi@xilinx.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --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.