public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Juraj Marcin <jmarcin@redhat.com>, virtio-comment@lists.linux.dev
Cc: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2] virtio-mem: introduce VIRTIO_MEM_F_PERSISTENT_SUSPEND
Date: Mon, 14 Oct 2024 14:01:22 +0200	[thread overview]
Message-ID: <95f857f3-a113-401b-ae8d-7bf0a53f261a@redhat.com> (raw)
In-Reply-To: <20241009090202.10544-2-jmarcin@redhat.com>

On 09.10.24 11:01, Juraj Marcin wrote:
> Before, the behavior while suspending to a deep sleep state and waking
> up was not specified. For example, in x86 QEMU VM all devices receive a
> reset request during wake-up. This would lead to unplugging of all the
> plugged memory blocks. Due to this, suspending is disallowed in the
> Linux Kernel, when plugged memory is present and
> VIRTIO_MEM_F_PERSISTENT_SUSPEND feature flag is not advertised by the
> virtio-mem device.
> 
> This new flag should signal to the guest driver, that the device can
> correctly suspend to a deep sleep state and then wake up without
> disrupting the plugged memory blocks. This feature flag is already
> supported in the Linux Kernel [1] and also supported in QEMU [2].
> 
> [1]: https://lore.kernel.org/all/20240318120645.105664-1-david@redhat.com/
> [2]: https://lore.kernel.org/all/20240904103722.946194-1-jmarcin@redhat.com/
> 
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Reviewed-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
> Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
> ---
> v2:
> - replaced "guest system" with "guest", suggested by Matias
> - updated QEMU patch series link
> ---
>   device-types/mem/description.tex | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/device-types/mem/description.tex b/device-types/mem/description.tex
> index 0a6d558..9acf63f 100644
> --- a/device-types/mem/description.tex
> +++ b/device-types/mem/description.tex
> @@ -60,6 +60,8 @@ \subsection{Feature bits}\label{sec:Device Types / Memory Device / Feature bits}
>   access unplugged memory. \footnote{On platforms with memory properties that
>   might get modified implicitly on memory access, this feature is expected to
>   be offered by the device.}
> +\item[VIRTIO_MEM_F_PERSISTENT_SUSPEND (2)] The driver can allow the guest
> +to enter suspended state (deep sleep, suspend-to-RAM).
>   \end{description}
>   
>   \subsection{Device configuration layout}\label{sec:Device Types / Memory Device / Device configuration layout}
> @@ -174,6 +176,9 @@ \subsection{Device Initialization}\label{Device Types / Memory Device / Device I
>   The device MUST NOT modify memory or memory properties of plugged memory
>   blocks during device reset.
>   
> +The device SHOULD offer VIRTIO_MEM_F_PERSISTENT_SUSPEND if the platform
> +supports suspending (deep sleep, suspend-to-RAM) with plugged memory blocks.
> +
>   \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Operation}
>   
>   The device notifies the driver about the amount of memory the device wants
> @@ -268,6 +273,9 @@ \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Op
>   memory blocks to unplug them, or it would not be able to make use of
>   unplugged memory blocks after plugging them (e.g., alignment).
>   
> +If VIRTIO_MEM_F_PERSISTENT_SUSPEND has not been negotiated, the driver MUST NOT
> +allow the guest to enter a suspended state (deep sleep, suspend-to-RAM).
> +
>   \devicenormative{\subsubsection}{Device Operation}{Device Types / Memory Device / Device Operation}
>   
>   The device MUST provide the exact same memory properties with the exact same
> @@ -293,6 +301,10 @@ \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Op
>   
>   The device SHOULD unplug all memory blocks during system resets.
>   
> +If VIRTIO_MEM_F_PERSISTENT_SUSPEND has been negotiated, the device MUST NOT not
> +change the state of memory blocks when suspending or when waking up from
> +suspended state (deep sleep, suspend-to-RAM).
> +
>   \subsubsection{PLUG request}\label{sec:Device Types / Memory Device / Device Operation / PLUG request}
>   
>   Request to plug consecutive memory blocks that are currently unplugged.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/207

v1 was on the list for more than 2 months, and there was only a minor 
change for v2.

Conny, Michael, can you please open a TC vote?

-- 
Cheers,

David / dhildenb


      reply	other threads:[~2024-10-14 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  9:01 [PATCH v2] virtio-mem: introduce VIRTIO_MEM_F_PERSISTENT_SUSPEND Juraj Marcin
2024-10-14 12:01 ` David Hildenbrand [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=95f857f3-a113-401b-ae8d-7bf0a53f261a@redhat.com \
    --to=david@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=mst@redhat.com \
    --cc=mvaralar@redhat.com \
    --cc=virtio-comment@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox