Skip to contentSkip to conversation

introduce basic facilities for virito live migration

PATCH In review Zhu Lingshan 4 participants 186 messages Nov 3, 2023 – Nov 27, 2023 Page 1 of 2

lore
Share & tools
lore
#0 lore raw

v2 cover introduce basic facilities for virito live migration

This series introduces basic facilities to support virtio live migration, includes:

1)a new SUSPEND bit in the device status
Which is used to suspend the device, so that the device states and virtqueue states are stabilized.

2)virtqueue state and its accessor, to get and set last_avail_idx and last_used_idx of virtqueues.

3)dirty page tracking

Changes from V1:
1)move vq state defination from content.tex to splited/packed.tex(Michael)
2)"the device should ignore resetting vqs when suspended" ==> "the driver should not reset vqs when suspended"(Michael) 3)add dirty page tracking facility

Zhu Lingshan (6):
virtio: introduce virtqueue state
virtio: introduce SUSPEND bit in device status
virtio: dont reset vqs when SUSPEND
virtio-pci: implement VIRTIO_F_QUEUE_STATE
virtio: introduce dirty page tracking facility
virtio-pci: implement dirty page tracking

 content.tex       | 66 ++++++++++++++++++++++++++++++++--
 packed-ring.tex   | 58 ++++++++++++++++++++++++++++++
 split-ring.tex    | 39 ++++++++++++++++++++
 transport-pci.tex | 90 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 251 insertions(+), 2 deletions(-)
Signature · 18 lines
2.35.3


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#1 lore raw

PATCH v2 1/6 virtio: introduce virtqueue state

This patch adds new virtqueue facility to save and restore virtqueue state. The virtqueue state is split into two parts:

- The available state: The state that is used for read the next available buffer.
- The used state: The state that is used for make buffer used.

This will simply the transport specific method implementation. E.g two le16 could be used instead of a single le32). For split virtqueue, we only need the available state since the used state is implemented in the virtqueue itself (the used index). For packed virtqueue, we need both the available state and the used state.

The typical use cases are live migration and debugging.

---
 content.tex     |  7 ++++--
 packed-ring.tex | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 split-ring.tex  | 39 +++++++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+), 2 deletions(-)
content.tex +5 -2
index 0a62dce..76813b5 100644
@@ -99,10 +99,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \begin{description}
 \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 41] Feature bits reserved for extensions to the queue and
+\item[24 to 42] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[42 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}
@@ -872,6 +872,9 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
 	handling features reserved for future use.
 
+  \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
+  to access its internal virtqueue state.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
packed-ring.tex +58 -0

61 lines not on this page · raw message

split-ring.tex +39 -0
index de94038..a78b44d 100644
@@ -734,3 +734,42 @@ \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o
 }
 \end{lstlisting}
 \end{note}
+
+\subsection{Virtqueue State}\label{sec:Basic Facilities of a Virtio Device / Splited Virtqueues / Virtqueue State}
+
+When VIRTIO_F_QUEUE_STATE has been negotiated, the driver can set and
+get the device internal virtqueue state through the following
+fields. The implementation of the interfaces is transport specific.
+
+\subsubsection{\field{Available State} Field}
+
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 last_avail_idx;
+\end{lstlisting}
+
+The \field{last_avail_idx} field is the free-running available ring
+index where the device will read the next available head of a
+descriptor chain.
+
+See also \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Available Ring}.
+
+\drivernormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The driver SHOULD NOT access \field{Used State} of any splited virtqueues, it SHOULD use the
+used index in the used ring.
+
+\devicenormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The device SHOULD only accept setting Virtqueue State of any splited virtqueues
+when DRIVER_OK is not set in \field{device status} or SUSPEND is set in \field{device status}.
+Otherwise the device MUST ignore any writes to Virtqueue State of any splited virtqueues.
+
+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue
+in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue
+from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.
Signature · 18 lines
2.35.3


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#2 lore raw

[virtio-comment] RE: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 6 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds new virtqueue facility to save and restore virtqueue state. The virtqueue state is split into two parts:

Quoted 8 lines

- The available state: The state that is used for read the next available buffer.
- The used state: The state that is used for make buffer used.

This will simply the transport specific method implementation. E.g two le16 could be used instead of a single le32). For split virtqueue, we only need the available state since the used state is implemented in the virtqueue itself (the used index).

Sorry, this does not work.
Refer to my latest series at [2] that covers used ring elements too. Commit change log covered the reasoning.

[2] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

#3 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 14 lines · Parav Pandit
Quoted 6 lines

From: Zhu Lingshan<[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds new virtqueue facility to save and restore virtqueue state. The virtqueue state is split into two parts:

Quoted 8 lines

- The available state: The state that is used for read the next available buffer.
- The used state: The state that is used for make buffer used.

This will simply the transport specific method implementation. E.g two le16 could be used instead of a single le32). For split virtqueue, we only need the available state since the used state is implemented in the virtqueue itself (the used index).

Quoted 5 lines

Sorry, this does not work.
Refer to my latest series at [2] that covers used ring elements too. Commit change log covered the reasoning.

[2]https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

this patch is to migrate device internal virtqueue state, not in-guest or in descriptor states, right?

Can you name any missing fields?

#4 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

In reply to Zhu Lingshan
Quoted 99 lines · Zhu Lingshan

This patch adds new virtqueue facility to save and restore virtqueue state. The virtqueue state is split into two parts:

- The available state: The state that is used for read the next available buffer.
- The used state: The state that is used for make buffer used.

This will simply the transport specific method implementation. E.g two le16 could be used instead of a single le32). For split virtqueue, we only need the available state since the used state is implemented in the virtqueue itself (the used index). For packed virtqueue, we need both the available state and the used state.

The typical use cases are live migration and debugging.

---
 content.tex     |  7 ++++--
 packed-ring.tex | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 split-ring.tex  | 39 +++++++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+), 2 deletions(-)
content.tex +5 -2
index 0a62dce..76813b5 100644
@@ -99,10 +99,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \begin{description}
 \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 41] Feature bits reserved for extensions to the queue and
+\item[24 to 42] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[42 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}
@@ -872,6 +872,9 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
 	handling features reserved for future use.
 
+  \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
+  to access its internal virtqueue state.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
packed-ring.tex +40 -0
index 9eeb382..ad6aba0 100644
@@ -729,3 +729,61 @@ \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o
         process_buffer(d);
 }
 \end{lstlisting}
+
+\subsection{Virtqueue State}\label{sec:Basic Facilities of a Virtio Device / Packed Virtqueues / Virtqueue State}
+
+When VIRTIO_F_QUEUE_STATE has been negotiated, the driver can set and
+get the device internal virtqueue state through the following
+fields. The implementation of the interfaces is transport specific.
+
+\subsubsection{\field{Available State} Field}
+
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 {
+  last_avail_idx : 15;
+  last_avail_wrap_counter : 1;
+};
+\end{lstlisting}
+
+The \field{last_avail_idx} field is the free-running location
+where the device read the next descriptor from the virtqueue descriptor ring.
+
+The \field{last_avail_wrap_counter} field is the last driver ring wrap
+counter that was observed by the device.
+
+See also \ref{sec:Packed Virtqueues / Driver and Device Ring Wrap Counters}.
+
+\subsubsection{\field{Used State} Field}
+
+The used state field is two bytes of virtqueue state that is used by
+the device when marking a buffer used. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 {
+  used_idx : 15;
+  used_wrap_counter : 1;
+};
+\end{lstlisting}
+
+The \field{used_idx} field is the free-running location where the device write the next

packed-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 781

Quoted 10 lines
packed-ring.tex +10 -0
+used descriptor to the descriptor ring.
+
+The \field{used_wrap_counter} field is the wrap counter that is used
+by the device.
+
+See also \ref{sec:Packed Virtqueues / Driver and Device Ring Wrap Counters}.
+
+\devicenormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Packed Virtqueues/ Virtqueue State}
+
+The device SHOULD only accept setting Virtqueue State of any packed virtqueues when DRIVER_OK is not set in \field{device status}, or SUSPEND is set in \field{device status}.

Except SUSPEND is undefined and is explained in patch 2 :( Please do not split patches like this, you are just splitting them at random boundaries.

Quoted 38 lines
packed-ring.tex +8 -0
+Otherwise the device MUST ignore any writes to Virtqueue State of any packed virtqueues.
+
+When SUSPEND is set, the device MUST record the Virtqueue State of every enabled packed virtqueue
+in \field{Available State} field and \field{Used State} field respectively,
+and correspondingly restore the Virtqueue State of every enabled packed virtqueue
+from \field{Available State} field and \field{Used State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field and \field{Used State} field upon a device reset.
split-ring.tex +22 -0
index de94038..a78b44d 100644
@@ -734,3 +734,42 @@ \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o
 }
 \end{lstlisting}
 \end{note}
+
+\subsection{Virtqueue State}\label{sec:Basic Facilities of a Virtio Device / Splited Virtqueues / Virtqueue State}
+
+When VIRTIO_F_QUEUE_STATE has been negotiated, the driver can set and
+get the device internal virtqueue state through the following
+fields. The implementation of the interfaces is transport specific.
+
+\subsubsection{\field{Available State} Field}
+
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 last_avail_idx;
+\end{lstlisting}
+
+The \field{last_avail_idx} field is the free-running available ring
+index where the device will read the next available head of a
+descriptor chain.
+
+See also \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Available Ring}.
+

split-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 768

Quoted 10 lines
split-ring.tex +10 -0
+\drivernormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The driver SHOULD NOT access \field{Used State} of any splited virtqueues, it SHOULD use the
+used index in the used ring.
+
+\devicenormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The device SHOULD only accept setting Virtqueue State of any splited virtqueues
+when DRIVER_OK is not set in \field{device status} or SUSPEND is set in \field{device status}.
+Otherwise the device MUST ignore any writes to Virtqueue State of any splited virtqueues.

all these requests to ignore writes are to what end? just prohibit driver from doing this.

split-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 775

Quoted 7 lines
split-ring.tex +7 -0
+
+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue
+in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue
+from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer
- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Quoted 2 lines
Signature · 1 line
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#5 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 105 lines · Michael S. Tsirkin
Quoted 104 lines · Zhu Lingshan

This patch adds new virtqueue facility to save and restore virtqueue state. The virtqueue state is split into two parts:

- The available state: The state that is used for read the next available buffer.
- The used state: The state that is used for make buffer used.

This will simply the transport specific method implementation. E.g two le16 could be used instead of a single le32). For split virtqueue, we only need the available state since the used state is implemented in the virtqueue itself (the used index). For packed virtqueue, we need both the available state and the used state.

The typical use cases are live migration and debugging.

---
  content.tex     |  7 ++++--
  packed-ring.tex | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
  split-ring.tex  | 39 +++++++++++++++++++++++++++++++++
  3 files changed, 102 insertions(+), 2 deletions(-)
content.tex +5 -2
index 0a62dce..76813b5 100644
@@ -99,10 +99,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
  \begin{description}
  \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 41] Feature bits reserved for extensions to the queue and
+\item[24 to 42] Feature bits reserved for extensions to the queue and
    feature negotiation mechanisms
 
-\item[42 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
  \end{description}
 
  \begin{note}
@@ -872,6 +872,9 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
  	\ref{devicenormative:Basic Facilities of a Virtio Device / Feature Bits} for
  	handling features reserved for future use.
 
+  \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
+  to access its internal virtqueue state.
+
  \end{description}
 
  \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
packed-ring.tex +45 -0
index 9eeb382..ad6aba0 100644
@@ -729,3 +729,61 @@ \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o
          process_buffer(d);
  }
  \end{lstlisting}
+
+\subsection{Virtqueue State}\label{sec:Basic Facilities of a Virtio Device / Packed Virtqueues / Virtqueue State}
+
+When VIRTIO_F_QUEUE_STATE has been negotiated, the driver can set and
+get the device internal virtqueue state through the following
+fields. The implementation of the interfaces is transport specific.
+
+\subsubsection{\field{Available State} Field}
+
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 {
+  last_avail_idx : 15;
+  last_avail_wrap_counter : 1;
+};
+\end{lstlisting}
+
+The \field{last_avail_idx} field is the free-running location
+where the device read the next descriptor from the virtqueue descriptor ring.
+
+The \field{last_avail_wrap_counter} field is the last driver ring wrap
+counter that was observed by the device.
+
+See also \ref{sec:Packed Virtqueues / Driver and Device Ring Wrap Counters}.
+
+\subsubsection{\field{Used State} Field}
+
+The used state field is two bytes of virtqueue state that is used by
+the device when marking a buffer used. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 {
+  used_idx : 15;
+  used_wrap_counter : 1;
+};
+\end{lstlisting}
+
+The \field{used_idx} field is the free-running location where the device write the next
+used descriptor to the descriptor ring.
+
+The \field{used_wrap_counter} field is the wrap counter that is used
+by the device.
+
Quoted 8 lines

packed-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 781

Quoted 5 lines
packed-ring.tex +5 -0
+See also \ref{sec:Packed Virtqueues / Driver and Device Ring Wrap Counters}.
+
+\devicenormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Packed Virtqueues/ Virtqueue State}
+
+The device SHOULD only accept setting Virtqueue State of any packed virtqueues when DRIVER_OK is not set in \field{device status}, or SUSPEND is set in \field{device status}.

Except SUSPEND is undefined and is explained in patch 2 :( Please do not split patches like this, you are just splitting them at random boundaries.

will do.

Quoted 44 lines
Quoted 44 lines
packed-ring.tex +8 -0
+Otherwise the device MUST ignore any writes to Virtqueue State of any packed virtqueues.
+
+When SUSPEND is set, the device MUST record the Virtqueue State of every enabled packed virtqueue
+in \field{Available State} field and \field{Used State} field respectively,
+and correspondingly restore the Virtqueue State of every enabled packed virtqueue
+from \field{Available State} field and \field{Used State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field and \field{Used State} field upon a device reset.
split-ring.tex +26 -0
index de94038..a78b44d 100644
@@ -734,3 +734,42 @@ \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o
  }
  \end{lstlisting}
  \end{note}
+
+\subsection{Virtqueue State}\label{sec:Basic Facilities of a Virtio Device / Splited Virtqueues / Virtqueue State}
+
+When VIRTIO_F_QUEUE_STATE has been negotiated, the driver can set and
+get the device internal virtqueue state through the following
+fields. The implementation of the interfaces is transport specific.
+
+\subsubsection{\field{Available State} Field}
+
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the followwing format:
+
+\begin{lstlisting}
+le16 last_avail_idx;
+\end{lstlisting}
+
+The \field{last_avail_idx} field is the free-running available ring
+index where the device will read the next available head of a
+descriptor chain.
+
+See also \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Available Ring}.
+
+\drivernormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The driver SHOULD NOT access \field{Used State} of any splited virtqueues, it SHOULD use the
+used index in the used ring.
Quoted 8 lines

split-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 768

Quoted 6 lines
split-ring.tex +6 -0
+
+\devicenormative{\subsubsection}{Virtqueue State}{Basic Facilities of a Virtio Device / Splited Virtqueues/ Virtqueue State}
+
+The device SHOULD only accept setting Virtqueue State of any splited virtqueues
+when DRIVER_OK is not set in \field{device status} or SUSPEND is set in \field{device status}.
+Otherwise the device MUST ignore any writes to Virtqueue State of any splited virtqueues.

all these requests to ignore writes are to what end? just prohibit driver from doing this.

OK

Quoted 11 lines

split-ring.tex \subsection{Receiving Used Buffers From The Device}\label{sec:Basic Facilities o · line 775

Quoted 8 lines
split-ring.tex +7 -0
+
+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue
+in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue
+from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

not sure what is a random time, this is to request the device to reset
its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

Quoted 2 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

Quoted 5 lines
Quoted 5 lines
Signature · 2 lines
-- 
2.35.3
#6 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 7 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

Quoted 8 lines

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

Quoted 5 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#7 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

Quoted 7 lines
Quoted 4 lines

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

It says:
+The available state field is two bytes of virtqueue state that is used by +the device to read the next available buffer. It is presented in the following format:

Do you want me to add more descriptions?

Quoted 6 lines
Quoted 6 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

Quoted 7 lines

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

I am not sure I get it.

Used idx(not like packed vq, no over-writing descriptors) and other states are in guest memory, so migrated with guest migration.

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#8 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 27 lines · Lingshan
Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

Quoted 7 lines
Quoted 4 lines

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

It says:

(quoted diff) +2 -0
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the

following format:

Quoted 1 line

Do you want me to add more descriptions?

maybe start with an example

Quoted 13 lines
Quoted 6 lines
Quoted 6 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

Quoted 7 lines

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

Quoted 4 lines

I am not sure I get it.

Used idx(not like packed vq, no over-writing descriptors) and other states are in guest memory, so migrated with guest migration.

yes and so? why is that not enough and what is this available state then?

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#9 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 22 lines · Michael S. Tsirkin
Quoted 21 lines · Lingshan
Quoted 19 lines · Michael S. Tsirkin
Quoted 7 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

Quoted 8 lines

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

Quoted 7 lines
Quoted 6 lines

It says:

(quoted diff) +2 -0
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the

following format:

Do you want me to add more descriptions?

maybe start with an example

I think they are already in the spec, I can add:
see also "2.7.6 The Virtqueue Available Ring" and "2.7.13.1 Placing Buffers Into The Descriptor Table"

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

Quoted 5 lines
Quoted 4 lines

I am not sure I get it.

Used idx(not like packed vq, no over-writing descriptors) and other states are in guest memory, so migrated with guest migration.

yes and so? why is that not enough and what is this available state then?

The spec has illustrated how available index work and has given an example(see above cited sections) And this patch even has given a more clear description for it.

Other states are in guest memory and migrated with guest memory.

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#10 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 50 lines · Lingshan
Quoted 22 lines · Michael S. Tsirkin
Quoted 21 lines · Lingshan
Quoted 19 lines · Michael S. Tsirkin
Quoted 7 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

Quoted 8 lines

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

Quoted 7 lines
Quoted 6 lines

It says:

(quoted diff) +2 -0
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the

following format:

Do you want me to add more descriptions?

maybe start with an example

I think they are already in the spec, I can add:
see also "2.7.6 The Virtqueue Available Ring" and "2.7.13.1 Placing Buffers Into The Descriptor Table"

Quoted 15 lines
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

Quoted 7 lines

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

I am not sure I get it.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Used idx(not like packed vq, no over-writing descriptors) and other states are in guest memory, so migrated with guest migration.

yes and so? why is that not enough and what is this available state then?

The spec has illustrated how available index work and has given an example(see above cited sections)
And this patch even has given a more clear description for it.

Other states are in guest memory and migrated with guest memory.

Yea I wrote large parts of it and I know how the available index works.

And sorry no idea what you are talking about.

At any time, there can be up to 2^16 buffers that have been made available, and a random subset of these have been used. There is no chance in the world a single 16 bit index describes even that part of state, never mind device type specific processing that might be going on.

As a wild guest this proposal is making a bunch of unstated assumptions about device being in a very specific state where this *is* possible. For people to be able to implement devices and drivers these need to be spelled out.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#11 lore raw

[virtio-comment] Re: [PATCH V2 1/6] virtio: introduce virtqueue state

Quoted 66 lines · Michael S. Tsirkin
Quoted 47 lines · Lingshan
Quoted 21 lines · Michael S. Tsirkin
Quoted 20 lines · Lingshan
Quoted 19 lines · Michael S. Tsirkin
Quoted 7 lines · Lingshan

+When SUSPEND is set, the device MUST record the Available State of every enabled splited virtqueue +in \field{Available State} field,
+and correspondingly restore the Available State of every enabled splited virtqueue +from \field{Available State} field when DRIVER_OK is set.
+
+The device SHOULD reset \field{Available State} field upon a device reset.

Quoted 8 lines

At this point I have no idea
- how can a state of a virtqueue at a random time be represented by a 16 bit integer

not sure what is a random time, this is to request the device to reset its avail state, for example, it is "le16 queue_avail_state" in virtio-pci common cfg. Resetting this so the device will not recover from a wrong value of the last run.

You simply never bother to say what is "Available State" and what does it mean to restore it. Not to mention words like "splited" which just adds to the confusion.

Quoted 7 lines
Quoted 6 lines

It says:

(quoted diff) +2 -0
+The available state field is two bytes of virtqueue state that is used by
+the device to read the next available buffer. It is presented in the

following format:

Do you want me to add more descriptions?

maybe start with an example

I think they are already in the spec, I can add:
see also "2.7.6 The Virtqueue Available Ring" and "2.7.13.1 Placing Buffers Into The Descriptor Table"

Quoted 14 lines
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines

- if it's not at a random time then why do you even need an integer - synchronize queue to memory and then all state is in memory

Not sure what is a sync queue, but for example, "le16 queue_avail_state" for PCI transport exists in a cap.

Quoted 7 lines

I just point out that normally a lot of ring state is in memory. So you need to be much more specific about how you are augmenting that. For example, if buffers are used exactly in order for a split ring then used index seems to be exactly the same as last available index you describe - it's a free running counter. OTOH if they are not used in order then I don't see how is a single index sufficient to describe which ones have been used and which not.

I am not sure I get it.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Used idx(not like packed vq, no over-writing descriptors) and other states are in guest memory, so migrated with guest migration.

yes and so? why is that not enough and what is this available state then?

The spec has illustrated how available index work and has given an example(see above cited sections)
And this patch even has given a more clear description for it.

Other states are in guest memory and migrated with guest memory.

Yea I wrote large parts of it and I know how the available index works.

And sorry no idea what you are talking about.

At any time, there can be up to 2^16 buffers that have been made available, and a random subset of these have been used. There is no chance in the world a single 16 bit index describes even that part of state, never mind device type specific processing that might be going on.

Quoted 4 lines

As a wild guest this proposal is making a bunch of unstated assumptions about device being in a very specific state where this *is* possible. For people to be able to implement devices and drivers these need to be spelled out.

Thanks for your advice, I may need more hints to improve this patch.

If it is about when _F_IN_ORDER not negotiated, I found this section from the spec:

Some devices always use descriptors in the same order in which they have been made available. These devices can offer the VIRTIO_F_IN_ORDER feature. If negotiated, this knowledge allows devices to notify the use of a batch of buffers to the driver by only writing out a single used ring entry with the id corresponding to the head entry of the descriptor chain describing the last buffer in the batch.
The device then skips forward in the ring according to the size of the batch. Accordingly, it increments the used idx by the size of the batch.

This section implies that if _F_IN_ORDER is not negotiated, the device may not able to process the descriptors in order, thus may not write only one used_idx for a batch of buffers. This is about how to make buffer used and used_idx is in the guest memory. If the device selective done processing some descriptors, then maybe just mark them done one by one than batching.

Here I see there are two kind of vq states, on device or in guest memory. So this series migrate the on device state explicitly and others are migrating with guest memory.

Can you be more specific on what parameters of a vq that I should address in this patch?

Thanks

Quoted 2 lines

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#12 lore raw

PATCH v2 2/6 virtio: introduce SUSPEND bit in device status

In reply to Zhu Lingshan

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

---
 content.tex | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
content.tex +34 -2
index 76813b5..bcc9d4b 100644
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 
 \item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
   an error from which it can't recover.
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that the
+  device has been suspended by the driver.
+
 \end{description}
 
 The \field{device status} field starts out as 0, and is reinitialized to 0 by
@@ -73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 recover by issuing a reset.
 \end{note}
 
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure the SUSPEND bit is set.
+
 \devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field}
 
 The device MUST NOT consume buffers or send any used buffer
@@ -82,6 +90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 that a reset is needed.  If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device
 MUST send a device configuration change notification to the driver.
 
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when SUSPEND is set.
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD clear SUSPEND
+and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND,
+the device SHOULD perform the following actions before presenting SUSPEND bit in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.
+\item Wait until all descriptors that being processed to finish and mark them as used.
+\item Flush all used buffer and send used buffer notifications to the driver.
+\item Record Virtqueue State of each enabled virtqueue, see section \ref{sec:Virtqueues / Virtqueue State}
+\item Pause its operation except \field{device status} and preserve configurations in its Device Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space}
+\end{itemize}
+
 \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}
 
 Each virtio device offers all the features it understands.  During
@@ -99,10 +127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \begin{description}
 \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 42] Feature bits reserved for extensions to the queue and
+\item[24 to 43] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
   \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
   to access its internal virtqueue state.
 
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
Signature · 18 lines
2.35.3


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#13 lore raw

[virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 6 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin commands method in [1] must work for passthrough and non-passthrough.

And halfway in the discussion you propose a method after learning all the limitations of in-band, you propose a solution only works for non-passthrough mode.

You asked someone to have comprehensive proposal and when it comes to you following it, you just don’t. And have most shallow commit message to not even mention it.

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

Quoted 98 lines
---
 content.tex | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
content.tex +0 -0
index 76813b5..bcc9d4b 100644
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic

Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
an error from which it can't recover.

content.tex +5 -0
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that
+the
+  device has been suspended by the driver.
+
 \end{description}
 
 The \field{device status} field starts out as 0, and is reinitialized to 0 by @@ -

73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev recover by issuing a reset.
\end{note}

content.tex +3 -0
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure

the SUSPEND bit is set.
+
\devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio
Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer @@ -82,6
+90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

content.tex +5 -0
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when SUSPEND

is set.

content.tex +6 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD
+clear SUSPEND and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND, the
+device SHOULD perform the following actions before presenting SUSPEND bit

in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.
+\item Wait until all descriptors that being processed to finish and mark them as used.
+\item Flush all used buffer and send used buffer notifications to the driver. +\item Record Virtqueue State of each enabled virtqueue, see section +\ref{sec:Virtqueues / Virtqueue State} \item Pause its operation except +\field{device status} and preserve configurations in its Device

content.tex +4 -0
+Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device /
+Device Configuration Space} \end{itemize}
+
 \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}
 
 Each virtio device offers all the features it understands.  During @@ -99,10
+127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device /

Feature B \begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device type

-\item[24 to 42] Feature bits reserved for extensions to the queue and +\item[24 to 43] Feature bits reserved for extensions to the queue and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions. +\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

\begin{note}

content.tex +0 -0
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved
 Feature Bits}
   \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device

allows the driver
to access its internal virtqueue state.

content.tex +4 -1
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--

2.35.3

#14 lore raw

[virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 10 lines · Parav Pandit
Quoted 10 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

Quoted 7 lines
Quoted 2 lines

You constantly complained that whatever was proposed using admin commands method in [1] must work for passthrough and non-passthrough.

And halfway in the discussion you propose a method after learning all the limitations of in-band, you propose a solution only works for non-passthrough mode.

You asked someone to have comprehensive proposal and when it comes to you following it, you just don’t.

not sure what you are talking about.

Quoted 4 lines

And have most shallow commit message to not even mention it.

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 5 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

Please don't be so emotional and please be professional.

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

Quoted 96 lines
Quoted 96 lines
---
  content.tex | 36 ++++++++++++++++++++++++++++++++++--
  1 file changed, 34 insertions(+), 2 deletions(-)
content.tex +0 -0
index 76813b5..bcc9d4b 100644
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic

Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
an error from which it can't recover.

content.tex +5 -0
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that
+the
+  device has been suspended by the driver.
+
  \end{description}
 
  The \field{device status} field starts out as 0, and is reinitialized to 0 by @@ -

73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev recover by issuing a reset.
\end{note}

content.tex +3 -0
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure

the SUSPEND bit is set.
+
\devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio
Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer @@ -82,6
+90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

content.tex +5 -0
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when SUSPEND

is set.

content.tex +6 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD
+clear SUSPEND and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND, the
+device SHOULD perform the following actions before presenting SUSPEND bit

in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.
+\item Wait until all descriptors that being processed to finish and mark them as used.
+\item Flush all used buffer and send used buffer notifications to the driver. +\item Record Virtqueue State of each enabled virtqueue, see section +\ref{sec:Virtqueues / Virtqueue State} \item Pause its operation except +\field{device status} and preserve configurations in its Device

content.tex +4 -0
+Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device /
+Device Configuration Space} \end{itemize}
+
  \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}
 
  Each virtio device offers all the features it understands.  During @@ -99,10
+127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device /

Feature B \begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device type

-\item[24 to 42] Feature bits reserved for extensions to the queue and +\item[24 to 43] Feature bits reserved for extensions to the queue and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions. +\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

\begin{note}

content.tex +0 -0
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved
 Feature Bits}
    \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device

allows the driver
to access its internal virtqueue state.

content.tex +4 -0
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
  \end{description}
Quoted 3 lines
Quoted 3 lines

\drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#15 lore raw

[virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 25 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 2 lines

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 2 lines

You asked someone to have comprehensive proposal and when it comes to

Quoted 11 lines

you following it, you just don’t.
not sure what you are talking about.

Quoted 4 lines

And have most shallow commit message to not even mention it.

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 3 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Your proposal does not cover both the use cases of passthrough and non-passthrough. Yet you kept demanding them for others.
This is just wrong.

I am aware that both models as technical pros and cons.

Quoted 9 lines
Quoted 4 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.h
tml

Please don't be so emotional and please be professional.

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

I explained 5 reasons why it does not work in previous reply.

As the word indicates "live migration", the hypervisor needs to access the device when it is "live" (not just after). Hence, passthrough mode must be able to capture the state of the device and dirty pages database when its live. (and after the source is suspended).

Quoted 114 lines
Quoted 6 lines
Quoted 6 lines
---
  content.tex | 36 ++++++++++++++++++++++++++++++++++--
  1 file changed, 34 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 7 lines
content.tex +0 -0
@@ -49,6 +49,10 @@ \section{\field{Device Status}

Field}\label{sec:Basic Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has

experienced

Quoted 71 lines
Quoted 71 lines

an error from which it can't recover.

content.tex +5 -0
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates
+that the
+  device has been suspended by the driver.
+
  \end{description}
 
  The \field{device status} field starts out as 0, and is

reinitialized to 0 by @@ -
73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev recover by issuing a reset.
\end{note}

content.tex +4 -0
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status}
+to ensure

the SUSPEND bit is set.
+
\devicenormative{\subsection}{Device Status Field}{Basic Facilities
of a Virtio Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer @@
-82,6
+90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic +Facilities of a
Virtio Dev that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

content.tex +6 -0
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when
+SUSPEND

is set.

content.tex +7 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device
+SHOULD clear SUSPEND and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND, the
+device SHOULD perform the following actions before presenting
+SUSPEND bit

in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.
+\item Wait until all descriptors that being processed to finish and +mark them
as used.
+\item Flush all used buffer and send used buffer notifications to the driver. +\item Record Virtqueue State of each enabled virtqueue, see section +\ref{sec:Virtqueues / Virtqueue State} \item Pause its operation

content.tex +4 -0
+except \field{device status} and preserve configurations in its
+Device Configuration Space, see \ref{sec:Basic Facilities of a
+Virtio Device / Device Configuration Space} \end{itemize}
+
  \section{Feature Bits}\label{sec:Basic Facilities of a Virtio

Device / Feature Bits}

Each virtio device offers all the features it understands. During
@@ -99,10
+127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a +Virtio Device /
Feature B \begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device
type

Quoted 7 lines
Quoted 7 lines

-\item[24 to 42] Feature bits reserved for extensions to the queue and
+\item[24 to 43] Feature bits reserved for extensions to the queue +and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future

extensions.

Quoted 21 lines
Quoted 21 lines

+\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

\begin{note}

content.tex +0 -0
@@ -875,6 +903,10 @@ \chapter{Reserved Feature
 Bits}\label{sec:Reserved Feature Bits}
    \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the

device allows the driver
to access its internal virtqueue state.

content.tex +4 -0
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
  \end{description}
 
  \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature

Bits}
--
2.35.3

#16 lore raw

[virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 30 lines · Parav Pandit
Quoted 30 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 1 line

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 1 line

You asked someone to have comprehensive proposal and when it comes to

you following it, you just don’t.
not sure what you are talking about.

Quoted 4 lines

And have most shallow commit message to not even mention it.

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Your proposal does not cover both the use cases of passthrough and non-passthrough. Yet you kept demanding them for others.
This is just wrong.

I am aware that both models as technical pros and cons.

Why this doesn't work? the device status byte has been working for many years, and do you know when guest freeze, the hypervisor owns the device????

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.h
tml

Please don't be so emotional and please be professional.

Quoted 8 lines
Quoted 3 lines

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

I explained 5 reasons why it does not work in previous reply.

As the word indicates "live migration", the hypervisor needs to access the device when it is "live" (not just after). Hence, passthrough mode must be able to capture the state of the device and dirty pages database when its live. (and after the source is suspended).

No, the hypervisor should only collect dirty pages when the device alive. As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

Quoted 110 lines
Quoted 110 lines
Quoted 6 lines
Quoted 6 lines
---
   content.tex | 36 ++++++++++++++++++++++++++++++++++--
   1 file changed, 34 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 7 lines
content.tex +0 -0
@@ -49,6 +49,10 @@ \section{\field{Device Status}

Field}\label{sec:Basic Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has

experienced

Quoted 71 lines
Quoted 71 lines

an error from which it can't recover.

content.tex +5 -0
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates
+that the
+  device has been suspended by the driver.
+
   \end{description}
 
   The \field{device status} field starts out as 0, and is

reinitialized to 0 by @@ -
73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev recover by issuing a reset.
\end{note}

content.tex +4 -0
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status}
+to ensure

the SUSPEND bit is set.
+
\devicenormative{\subsection}{Device Status Field}{Basic Facilities
of a Virtio Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer @@
-82,6
+90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic +Facilities of a
Virtio Dev that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

content.tex +6 -0
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when
+SUSPEND

is set.

content.tex +7 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device
+SHOULD clear SUSPEND and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND, the
+device SHOULD perform the following actions before presenting
+SUSPEND bit

in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.
+\item Wait until all descriptors that being processed to finish and +mark them
as used.
+\item Flush all used buffer and send used buffer notifications to the driver. +\item Record Virtqueue State of each enabled virtqueue, see section +\ref{sec:Virtqueues / Virtqueue State} \item Pause its operation

content.tex +4 -0
+except \field{device status} and preserve configurations in its
+Device Configuration Space, see \ref{sec:Basic Facilities of a
+Virtio Device / Device Configuration Space} \end{itemize}
+
   \section{Feature Bits}\label{sec:Basic Facilities of a Virtio

Device / Feature Bits}

Each virtio device offers all the features it understands. During
@@ -99,10
+127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a +Virtio Device /
Feature B \begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device
type

Quoted 7 lines
Quoted 7 lines

-\item[24 to 42] Feature bits reserved for extensions to the queue and
+\item[24 to 43] Feature bits reserved for extensions to the queue +and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future

extensions.

Quoted 17 lines
Quoted 17 lines

+\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

   \begin{note}
content.tex +0 -0
@@ -875,6 +903,10 @@ \chapter{Reserved Feature
 Bits}\label{sec:Reserved Feature Bits}
     \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the

device allows the driver
to access its internal virtqueue state.

content.tex +4 -0
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
   \end{description}
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

\drivernormative{\section}{Reserved Feature Bits}{Reserved Feature
Bits}
--
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#17 lore raw

[virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 39 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:00 AM

Quoted 34 lines · Parav Pandit
Quoted 34 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 2 lines

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 2 lines

You asked someone to have comprehensive proposal and when it comes to

you following it, you just don’t.
not sure what you are talking about.

Quoted 4 lines

And have most shallow commit message to not even mention it.

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 2 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Quoted 8 lines
Quoted 1 line

Your proposal does not cover both the use cases of passthrough and non-

passthrough.

Quoted 4 lines

Yet you kept demanding them for others.
This is just wrong.

I am aware that both models as technical pros and cons.

Why this doesn't work? the device status byte has been working for many years, and do you know when guest freeze, the hypervisor owns the device????

When the guest is not frozen and during the pre-copy phase, hypervisor needs to access the device (context, dirty pages). How does it work if the guest owns the device?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472
.h
tml

Please don't be so emotional and please be professional.

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

Quoted 8 lines
Quoted 3 lines

I explained 5 reasons why it does not work in previous reply.

As the word indicates "live migration", the hypervisor needs to access the

device when it is "live" (not just after).

Quoted 1 line

Hence, passthrough mode must be able to capture the state of the device and

dirty pages database when its live.

Quoted 1 line

(and after the source is suspended).

No, the hypervisor should only collect dirty pages when the device alive.

It is needed during both the times.
When the device and guest is live during pre-copy phase. And after the device is frozen, to get the final round of pages.

Quoted 3 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

Quoted 4 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

#18 lore raw

Re: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 40 lines · Parav Pandit
Quoted 40 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:00 AM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 2 lines

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 2 lines

You asked someone to have comprehensive proposal and when it comes to

you following it, you just don’t.
not sure what you are talking about.

Quoted 2 lines

And have most shallow commit message to not even mention it.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 2 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Your proposal does not cover both the use cases of passthrough and non-

passthrough.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Yet you kept demanding them for others.
This is just wrong.

I am aware that both models as technical pros and cons.

Why this doesn't work? the device status byte has been working for many years, and do you know when guest freeze, the hypervisor owns the device????

When the guest is not frozen and during the pre-copy phase, hypervisor needs to access the device (context, dirty pages). How does it work if the guest owns the device?

Have you seen PASID there?

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 10 lines
Quoted 5 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472
.h
tml

Please don't be so emotional and please be professional.

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

I explained 5 reasons why it does not work in previous reply.

As the word indicates "live migration", the hypervisor needs to access the

Quoted 8 lines
Quoted 5 lines

device when it is "live" (not just after).

Quoted 1 line

Hence, passthrough mode must be able to capture the state of the device and

dirty pages database when its live.

Quoted 1 line

(and after the source is suspended).

No, the hypervisor should only collect dirty pages when the device alive.

It is needed during both the times.
When the device and guest is live during pre-copy phase. And after the device is frozen, to get the final round of pages.

With PASID, dirty page tracking facility can be isolated from the guest, means the hypervisor owns this facility. So the hypervisor can collect the dirty pages.

When the device suspended, it should report the last round of dirty pages through dirty page tracking facility as expected.

This can work, right?

Quoted 5 lines
Quoted 4 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

It looks you don't know how PASID work.

Host can setup PASID to isolate some facilities, right?

Quoted 6 lines
Quoted 5 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

see above

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#19 lore raw

RE: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 49 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:51 PM

Quoted 44 lines · Parav Pandit
Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:00 AM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 2 lines

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 2 lines

You asked someone to have comprehensive proposal and when it comes to

you following it, you just don’t.
not sure what you are talking about.

Quoted 2 lines

And have most shallow commit message to not even mention it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 2 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Your proposal does not cover both the use cases of passthrough and non-

passthrough.

Quoted 3 lines

Yet you kept demanding them for others.
This is just wrong.

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I am aware that both models as technical pros and cons.

Why this doesn't work? the device status byte has been working for many years, and do you know when guest freeze, the hypervisor owns the

device????

Quoted 1 line

When the guest is not frozen and during the pre-copy phase, hypervisor needs

to access the device (context, dirty pages).

Quoted 1 line

How does it work if the guest owns the device?

Have you seen PASID there?

PASID does not help because as explained virtio common config space and device specific config space is owned by the guest driver.

Secondly PASID space is also owned by the guest driver.

Quoted 24 lines
Quoted 16 lines
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg004
72
.h
tml

Please don't be so emotional and please be professional.

Quoted 7 lines
Quoted 3 lines

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

I explained 5 reasons why it does not work in previous reply.

As the word indicates "live migration", the hypervisor needs to access the

device when it is "live" (not just after).

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Hence, passthrough mode must be able to capture the state of the device and

dirty pages database when its live.

Quoted 1 line

(and after the source is suspended).

No, the hypervisor should only collect dirty pages when the device alive.

It is needed during both the times.
When the device and guest is live during pre-copy phase. And after the device is frozen, to get the final round of pages.

Quoted 7 lines

With PASID, dirty page tracking facility can be isolated from the guest, means the hypervisor owns this facility. So the hypervisor can collect the dirty pages.

When the device suspended, it should report the last round of dirty pages through dirty page tracking facility as expected.

This can work, right?

Unfortunately no, as non atomic bitmap cannot reside in the host memory,
And whatever is in the device gets reset on device reset and/or FLR. So the dirty map detail is lost. Similarly the device context is also lost on these two events triggered by guest.

Quoted 10 lines
Quoted 6 lines
Quoted 5 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

It looks you don't know how PASID work.

Host can setup PASID to isolate some facilities, right?

There are few limitations with PASID.
a. All platforms do not have PASID and
b. I explained above PASID do not work always as PASID only bifurcates DMA not the device _functionality_. c. PASID to be available to guest as_is what is present on the device

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

see above

#20 lore raw

Re: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 51 lines · Parav Pandit
Quoted 51 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:51 PM

Quoted 47 lines · Parav Pandit
Quoted 47 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:00 AM

Quoted 28 lines · Parav Pandit
Quoted 28 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 3, 2023 8:25 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch introduces a new status bit in the device status: SUSPEND.

Quoted 8 lines
Quoted 7 lines

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

You constantly complained that whatever was proposed using admin

commands method in [1] must work for passthrough and non-passthrough.

Quoted 2 lines

And halfway in the discussion you propose a method after learning all the

limitations of in-band, you propose a solution only works for non-passthrough mode.

Quoted 2 lines

You asked someone to have comprehensive proposal and when it comes to

you following it, you just don’t.
not sure what you are talking about.

Quoted 2 lines

And have most shallow commit message to not even mention it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Please be consistent in design approach.
And if you don’t want to be, stop asking others.

this SUSPEND/RESUME doesn't change since the RFC series, how can it not be inconsistent???

Quoted 2 lines

This is not the way TC collaboration works.
I probably shouldn’t even expect this from you.

Your proposal does not cover both the use cases of passthrough and non-

passthrough.

Quoted 4 lines

Yet you kept demanding them for others.
This is just wrong.

I am aware that both models as technical pros and cons.

Why this doesn't work? the device status byte has been working for many years, and do you know when guest freeze, the hypervisor owns the

Quoted 8 lines
Quoted 5 lines

device????

Quoted 1 line

When the guest is not frozen and during the pre-copy phase, hypervisor needs

to access the device (context, dirty pages).

Quoted 1 line

How does it work if the guest owns the device?

Have you seen PASID there?

PASID does not help because as explained virtio common config space and device specific config space is owned by the guest driver.

Secondly PASID space is also owned by the guest driver.

hypervisor sets a PASID to isolate the cap.

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 13 lines
Quoted 13 lines
Quoted 11 lines
Quoted 6 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg004
72
.h
tml

Please don't be so emotional and please be professional.

Why this solution can not work for pass-through? Do you know the device ownership will be transferred to the hypervisor when guest suspended in live migration?

I explained 5 reasons why it does not work in previous reply.

Quoted 8 lines
Quoted 2 lines

As the word indicates "live migration", the hypervisor needs to access the

device when it is "live" (not just after).

Quoted 2 lines

Hence, passthrough mode must be able to capture the state of the device and

dirty pages database when its live.

Quoted 1 line

(and after the source is suspended).

No, the hypervisor should only collect dirty pages when the device alive.

It is needed during both the times.
When the device and guest is live during pre-copy phase. And after the device is frozen, to get the final round of pages.

Quoted 8 lines
Quoted 7 lines

With PASID, dirty page tracking facility can be isolated from the guest, means the hypervisor owns this facility. So the hypervisor can collect the dirty pages.

When the device suspended, it should report the last round of dirty pages through dirty page tracking facility as expected.

This can work, right?

Unfortunately no, as non atomic bitmap cannot reside in the host memory,

as explained before, PCI and CPU supports atomic read/write. Please refer to PCI spec and CPU ISA.

Quoted 2 lines

And whatever is in the device gets reset on device reset and/or FLR. So the dirty map detail is lost. Similarly the device context is also lost on these two events triggered by guest.

we explained before, when reset, the device should clear everything.

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

It looks you don't know how PASID work.
Host can setup PASID to isolate some facilities, right?

There are few limitations with PASID.
a. All platforms do not have PASID and

As we have explained for many times, this is a basic facility, and the implementation is transport-specific.

We given an example of PCI implementation, and PCI support PASID, right?

Quoted 1 line

b. I explained above PASID do not work always as PASID only bifurcates DMA not the device _functionality_.

With a PASID, a cap can be considered to be placed in another logical address space, which is not accessible to the guest.

Quoted 1 line

c. PASID to be available to guest as_is what is present on the device

host hypervisor sets the PASID, transparent to the guest.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

see above

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#21 lore raw

Re: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 4 lines · Lingshan
Quoted 2 lines
Quoted 1 line

This can work, right?

Unfortunately no, as non atomic bitmap cannot reside in the host memory,

as explained before, PCI and CPU supports atomic read/write. Please refer to PCI spec and CPU ISA.

I don't see how atomic read or write does anything useful here but maybe. You need to explain how you are using atomics in your proposal then.

Quoted 3 lines
Quoted 2 lines

And whatever is in the device gets reset on device reset and/or FLR. So the dirty map detail is lost. Similarly the device context is also lost on these two events triggered by guest.

we explained before, when reset, the device should clear everything.

then migration will corrupt memory. Not great.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

It looks you don't know how PASID work.
Host can setup PASID to isolate some facilities, right?

There are few limitations with PASID.
a. All platforms do not have PASID and

As we have explained for many times, this is a basic facility, and the implementation is transport-specific.

We given an example of PCI implementation, and PCI support PASID, right?

Yes it's a limitation but maybe one we can live with for this feature. It does mean that we might need solutions for systems without this support. virtio use is not limited to servers or high end systems.

Quoted 5 lines
Quoted 1 line

b. I explained above PASID do not work always as PASID only bifurcates DMA not the device _functionality_.

With a PASID, a cap can be considered to be placed in another logical address space, which is not accessible to the guest.

Quoted 1 line

c. PASID to be available to guest as_is what is present on the device

host hypervisor sets the PASID, transparent to the guest.

Lingshan whenever people ask you a ton of questions in response to your spec proposal then respose should not be to simply
answer on the mailing list and then repost without a lot of changes since spec readers will likely have questions exactly like these and we can not make them go and read this flame war.
And frankly, most of this TC stopped following this thread a while ago, it seems to be going nowhere.
The response should be to add the explanation in the spec.
Look at Parav's live migration proposals with "theory of operation" chapters for an example of how this can be done.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

see above

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#22 lore raw

Re: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 6 lines · Michael S. Tsirkin
Quoted 4 lines · Lingshan
Quoted 2 lines
Quoted 1 line

This can work, right?

Unfortunately no, as non atomic bitmap cannot reside in the host memory,

as explained before, PCI and CPU supports atomic read/write. Please refer to PCI spec and CPU ISA.

I don't see how atomic read or write does anything useful here but maybe.

Because the device writs the bitmap and the driver "read and clear" the bitmap, so the ops need to be atomic, or they can run into race.

Quoted 1 line

You need to explain how you are using atomics in your proposal then.

Not sure we should talk about much of how atomic works, as explained above the operations should be atomic to avoid race conditions or losing information. Like:

1) Device Read
2) Device Write
3) Device Clear

Here we lost the bitmap information.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

And whatever is in the device gets reset on device reset and/or FLR. So the dirty map detail is lost. Similarly the device context is also lost on these two events triggered by guest.

we explained before, when reset, the device should clear everything.

then migration will corrupt memory. Not great.

I think when reset, the device should clear everything, therefore the driver should clear the legacy data as well, don't know how corrupt

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 10 lines
Quoted 8 lines
Quoted 7 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Nothing to do with PASID, as PASID is owned by the guest.

It looks you don't know how PASID work.
Host can setup PASID to isolate some facilities, right?

There are few limitations with PASID.
a. All platforms do not have PASID and

Quoted 8 lines
Quoted 4 lines

As we have explained for many times, this is a basic facility, and the implementation is transport-specific.

We given an example of PCI implementation, and PCI support PASID, right?

Yes it's a limitation but maybe one we can live with for this feature. It does mean that we might need solutions for systems without this support. virtio use is not limited to servers or high end systems.

PASID has been introduced years ago and I know some vendors implemented onboard IOMMU can also do isolating.

And this is a basic facility, the implementation is transport specific.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

b. I explained above PASID do not work always as PASID only bifurcates DMA not the device _functionality_.

With a PASID, a cap can be considered to be placed in another logical address space, which is not accessible to the guest.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

c. PASID to be available to guest as_is what is present on the device

host hypervisor sets the PASID, transparent to the guest.

Lingshan whenever people ask you a ton of questions in response to your spec proposal then respose should not be to simply answer on the mailing list and then repost without a lot of changes since spec readers will likely have questions exactly like these and we can not make them go and read this flame war.

Well, I should say, I have repeated the same answers for too many times.

Quoted 2 lines

And frankly, most of this TC stopped following this thread a while ago, it seems to be going nowhere.

I still believe we should release the best quality of spec as we can.

Quoted 3 lines

The response should be to add the explanation in the spec.
Look at Parav's live migration proposals with "theory of operation" chapters for an example of how this can be done.

I am not sure we should talk how PCI work in virtio spec. But I can add "pasid for isolation"

These facilities are not only used for live migration, can also work for debugging. Like suspend then read vq state.

I can add more explanation in the cover letter

Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Then suspend the device after guest freeze, to stabilize the device status, then read the status.

How can you say this does not work???

I explained above.

see above

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Quoted 9 lines

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#23 lore raw

Re: [virtio-comment] RE: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 17 lines · Lingshan
Quoted 6 lines · Michael S. Tsirkin
Quoted 4 lines · Lingshan
Quoted 2 lines
Quoted 1 line

This can work, right?

Unfortunately no, as non atomic bitmap cannot reside in the host memory,

as explained before, PCI and CPU supports atomic read/write. Please refer to PCI spec and CPU ISA.

I don't see how atomic read or write does anything useful here but maybe.

Because the device writs the bitmap and the driver "read and clear" the bitmap, so the ops need to be atomic, or they can run into race.

Quoted 1 line

You need to explain how you are using atomics in your proposal then.

Not sure we should talk about much of how atomic works, as explained above the operations should be atomic to avoid race conditions or losing information.
Like:

Quoted 5 lines

1) Device Read
2) Device Write
3) Device Clear

Here we lost the bitmap information.

That's an unusual use of the term "race condition". But yes, you need to spell out how do driver and device interact.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

And whatever is in the device gets reset on device reset and/or FLR. So the dirty map detail is lost. Similarly the device context is also lost on these two events triggered by guest.

we explained before, when reset, the device should clear everything.

then migration will corrupt memory. Not great.

I think when reset, the device should clear everything, therefore the driver should clear the legacy data as well, don't know how corrupt

If you write data in memory CPU will observe it. If you then migrate the CPU but not the memory then CPU and memory state are inconsistent. I am surprised I need to say that, maybe I misunderstand the question.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

As you can see, the dirty page tracking facility has a PASID for isolation. But still, the question is, we should better use platform dirty page tracking

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Nothing to do with PASID, as PASID is owned by the guest.

It looks you don't know how PASID work.
Host can setup PASID to isolate some facilities, right?

There are few limitations with PASID.
a. All platforms do not have PASID and

As we have explained for many times, this is a basic facility, and the implementation is transport-specific.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

We given an example of PCI implementation, and PCI support PASID, right?

Yes it's a limitation but maybe one we can live with for this feature. It does mean that we might need solutions for systems without this support. virtio use is not limited to servers or high end systems.

PASID has been introduced years ago and I know some vendors implemented onboard IOMMU can also do isolating.

Introduced yes but when was it actually implemented? Do you know?

Quoted 2 lines

And this is a basic facility, the implementation is transport specific.

That's why if no one wants to support systems without PASID this is, maybe, ok. But we know there are people who want this.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

b. I explained above PASID do not work always as PASID only bifurcates DMA not the device _functionality_.

With a PASID, a cap can be considered to be placed in another logical address space, which is not accessible to the guest.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Quoted 1 line

c. PASID to be available to guest as_is what is present on the device

host hypervisor sets the PASID, transparent to the guest.

Lingshan whenever people ask you a ton of questions in response to your spec proposal then respose should not be to simply answer on the mailing list and then repost without a lot of changes since spec readers will likely have questions exactly like these and we can not make them go and read this flame war.

Well, I should say, I have repeated the same answers for too many times.

Don't. Amend the spec proposal instead so readers don't have these questions.

Quoted 4 lines
Quoted 2 lines

And frankly, most of this TC stopped following this thread a while ago, it seems to be going nowhere.

I still believe we should release the best quality of spec as we can.

Quoted 8 lines
Quoted 3 lines

The response should be to add the explanation in the spec.
Look at Parav's live migration proposals with "theory of operation" chapters for an example of how this can be done.

I am not sure we should talk how PCI work in virtio spec. But I can add "pasid for isolation"

These facilities are not only used for live migration, can also work for debugging. Like suspend then read vq state.

Maybe. Then you need to document what is this state.

Quoted 1 line

I can add more explanation in the cover letter

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#24 lore raw

[virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

In reply to Zhu Lingshan
Quoted 19 lines · Zhu Lingshan

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

---
 content.tex | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
content.tex +0 -0
index 76813b5..bcc9d4b 100644

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 55

Quoted 7 lines
content.tex +4 -0
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 
 \item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
   an error from which it can't recover.
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that the
+  device has been suspended by the driver.
+

what does this mean?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 83

Quoted 11 lines
content.tex +4 -0
 \end{description}
 
 The \field{device status} field starts out as 0, and is reinitialized to 0 by
@@ -73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 recover by issuing a reset.
 \end{note}
 
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure the SUSPEND bit is set.
+

and if it's not?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 97

Quoted 12 lines
content.tex +5 -0
 \devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field}
 
 The device MUST NOT consume buffers or send any used buffer
@@ -82,6 +90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 that a reset is needed.  If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device
 MUST send a device configuration change notification to the driver.
 
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when SUSPEND is set.

which settings?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 106

Quoted 9 lines
content.tex +9 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD clear SUSPEND
+and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND,
+the device SHOULD perform the following actions before presenting SUSPEND bit in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.

descritors? and what does finished mean?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 107

Quoted 1 line
content.tex +1 -0
+\item Wait until all descriptors that being processed to finish and mark them as used.

descriptors are not marked used. buffers are.

that being -> that are being maybe?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 108

Quoted 1 line
content.tex +1 -0
+\item Flush all used buffer and send used buffer notifications to the driver.

used buffers?
what does Flush mean?

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 109

Quoted 1 line
content.tex +1 -0
+\item Record Virtqueue State of each enabled virtqueue, see section \ref{sec:Virtqueues / Virtqueue State}

execpt that one unfortunately does not bother to say what does this mean :(

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 110

Quoted 1 line
content.tex +1 -0
+\item Pause its operation except \field{device status} and preserve configurations in its Device Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space}

How do you Pause? For example, consider a link state register. You set SUSPEND, then link goes down. What is device supposed to do? Record this somewhere internal but do not show it to driver? And how exactly will this hidden internal state be migrated since it is not visible?

Quoted 19 lines
content.tex +4 -2
+\end{itemize}
+
 \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}
 
 Each virtio device offers all the features it understands.  During
@@ -99,10 +127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
 \begin{description}
 \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 42] Feature bits reserved for extensions to the queue and
+\item[24 to 43] Feature bits reserved for extensions to the queue and
   feature negotiation mechanisms
 
-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
 \end{description}
 
 \begin{note}

content.tex \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} · line 907

Quoted 5 lines
content.tex +2 -0
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
   \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
   to access its internal virtqueue state.
 
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.

why is SUSPEND upper-case here?

Quoted 7 lines
content.tex +2 -0
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
 \end{description}
 
 \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
Signature · 1 line
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#25 lore raw

Re: [virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 21 lines · Michael S. Tsirkin
Quoted 20 lines · Zhu Lingshan

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

---
  content.tex | 36 ++++++++++++++++++++++++++++++++++--
  1 file changed, 34 insertions(+), 2 deletions(-)
content.tex +0 -0
index 76813b5..bcc9d4b 100644
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
 
Quoted 7 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 55

Quoted 6 lines
content.tex +4 -0
  \item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
    an error from which it can't recover.
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that the
+  device has been suspended by the driver.
+

what does this mean?

When the driver sets SUSPEND and the device presents SUSPEND, means the device has been suspended by the driver.

Do you suggest to remove "When VIRTIO_F_SUSPEND is negotiated"

Quoted 8 lines
Quoted 8 lines
content.tex +0 -0
  \end{description}
 
  The \field{device status} field starts out as 0, and is reinitialized to 0 by
@@ -73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
  recover by issuing a reset.
  \end{note}
 
Quoted 5 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 83

Quoted 4 lines
content.tex +4 -0
+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure the SUSPEND bit is set.
+

and if it's not?

Then the device may run into errors or just need longer time to suspend.

This is how we handle features_OK: "Re-read device status to ensure the FEATURES_OK bit is still set"

Quoted 8 lines
Quoted 8 lines
content.tex +0 -0
  \devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field}
 
  The device MUST NOT consume buffers or send any used buffer
@@ -82,6 +90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
  that a reset is needed.  If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device
  MUST send a device configuration change notification to the driver.
 
Quoted 6 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 97

Quoted 5 lines
content.tex +5 -0
+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated.
+
+The device SHOULD allow settings to \field{device status} even when SUSPEND is set.

which settings?

any legit writing to the device status, like DRIVER_OK

Quoted 11 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 106

Quoted 10 lines
content.tex +9 -0
+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD clear SUSPEND
+and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND,
+the device SHOULD perform the following actions before presenting SUSPEND bit in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.

descritors? and what does finished mean?

Sorry my typo.

Finished means done processing it.

Like the spec words: When the device has finished a buffer, it writes the descriptor index into the used ring, and sends a used buffer notification.

Quoted 5 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 107

Quoted 2 lines
content.tex +1 -0
+\item Wait until all descriptors that being processed to finish and mark them as used.

descriptors are not marked used. buffers are.

that being -> that are being maybe?

Will fix

Quoted 3 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 108

Quoted 2 lines
content.tex +1 -0
+\item Flush all used buffer and send used buffer notifications to the driver.

used buffers?

Here it means the buffer marked as used. shall I use finished buffer or any other suggestions?

Quoted 1 line

what does Flush mean?

Flush means send all of them out. Like 5.19.7.1 Device Requirements: Device Operation: Virtqueue flush

Quoted 4 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 109

Quoted 2 lines
content.tex +1 -0
+\item Record Virtqueue State of each enabled virtqueue, see section \ref{sec:Virtqueues / Virtqueue State}

execpt that one unfortunately does not bother to say what does this mean :(

The virtqueue state has been defined in this series, in packed/split-ring.tex. And an PCI implementation of the interfaces is included.

Do you suggest any supplementary materials?

Quoted 3 lines

content.tex \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev · line 110

Quoted 2 lines
content.tex +1 -0
+\item Pause its operation except \field{device status} and preserve configurations in its Device Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space}

How do you Pause? For example, consider a link state register. You set

The device pauses itself.

Quoted 1 line

SUSPEND, then link goes down. What is device supposed to do?

Once the device suspended, the device should not respond to the link_down until alive again. This is to preserve the device states, just record whatever it is when SUSPEND-ed. And process the signal when resume or alive at the destination side. At the destination it also needs a live announce which require an active link.

Quoted 3 lines

Record this somewhere internal but do not show it to driver? And how exactly will this hidden internal state be migrated since it is not visible?

May I know what kind of internal states?
This series migrates stateless devices, hard to define virtio-fs device context.

Quoted 19 lines
Quoted 19 lines
content.tex +4 -2
+\end{itemize}
+
  \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}
 
  Each virtio device offers all the features it understands.  During
@@ -99,10 +127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
  \begin{description}
  \item[0 to 23, and 50 to 127] Feature bits for the specific device type
 
-\item[24 to 42] Feature bits reserved for extensions to the queue and
+\item[24 to 43] Feature bits reserved for extensions to the queue and
    feature negotiation mechanisms
 
-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions.
+\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
  \end{description}
 
Quoted 8 lines

content.tex \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits} · line 907

Quoted 7 lines
content.tex +2 -0
  \begin{note}
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
    \item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver
    to access its internal virtqueue state.
 
+  \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+   SUSPEND the device.

why is SUSPEND upper-case here?

will be lower in V3.

Thanks

Quoted 25 lines
Quoted 8 lines
content.tex +2 -0
+   See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
  \end{description}
 
  \drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
Signature · 1 line
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe:[email protected] Unsubscribe:[email protected]
List help:[email protected]
List archive:https://lists.oasis-open.org/archives/virtio-comment/ Feedback License:https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines:https://www.oasis-open.org/policies-guidelines/mailing-lists Committee:https://www.oasis-open.org/committees/virtio/
Join OASIS:https://www.oasis-open.org/join/

#26 lore raw

Re: [virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 33 lines · Lingshan

On 11/6/2023 5:43 PM, Michael S. Tsirkin wrote:

On Fri, Nov 03, 2023 at 06:34:33PM +0800, Zhu Lingshan wrote:

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

---
content.tex | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/content.tex b/content.tex
index 76813b5..bcc9d4b 100644
--- a/content.tex
+++ b/content.tex
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
an error from which it can't recover.
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that the
+ device has been suspended by the driver.
+

Quoted 7 lines

what does this mean?

When the driver sets SUSPEND and the device presents SUSPEND, means the device has been suspended by the driver.

Do you suggest to remove "When VIRTIO_F_SUSPEND is negotiated"

No I suggest explaining what does it mean that device has been suspended.

Quoted 8 lines

\end{description}

The \field{device status} field starts out as 0, and is reinitialized to 0 by
@@ -73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
recover by issuing a reset.
\end{note}

Quoted 8 lines

+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure the SUSPEND bit is set. +

and if it's not?

Then the device may run into errors or just need longer time to suspend.

and then what does driver do?

Quoted 2 lines

This is how we handle features_OK: "Re-read device status to ensure the FEATURES_OK bit is still set"

this is designed in case features are inconsistent. what kind of thing are you handling here?
Also and then we bail out and retry with other feature set if not. what do we do here?

Quoted 15 lines

\devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer
@@ -82,6 +90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated. +
+The device SHOULD allow settings to \field{device status} even when SUSPEND is set.

Quoted 4 lines

which settings?

any legit writing to the device status, like DRIVER_OK

that's not "settings" that's setting.

Quoted 11 lines

+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD clear SUSPEND +and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND,
+the device SHOULD perform the following actions before presenting SUSPEND bit in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.

Quoted 9 lines

descritors? and what does finished mean?

Sorry my typo.

Finished means done processing it.

Like the spec words: When the device has finished a buffer, it writes the descriptor index into the used ring, and sends a used buffer notification.

only good for internal ring documentation - we did not want to say used because it's not used until used entry written. here just say used.

Quoted 32 lines

+\item Wait until all descriptors that being processed to finish and mark them as used.

descriptors are not marked used. buffers are.

that being -> that are being maybe?

Will fix

+\item Flush all used buffer and send used buffer notifications to the driver.

used buffers?

Here it means the buffer marked as used. shall I use finished buffer or any other suggestions?

what does Flush mean?

Flush means send all of them out. Like 5.19.7.1 Device Requirements: Device
Operation: Virtqueue flush

        +\item Record Virtqueue State of each enabled virtqueue, see section \ref{sec:Virtqueues / Virtqueue State}

    execpt that one unfortunately does not bother to say what does this mean
    :(
Quoted 5 lines

The virtqueue state has been defined in this series, in packed/split-ring.tex. And an PCI implementation of the interfaces is included.

Do you suggest any supplementary materials?

I suggest something that documents what it means unlike what is in this series.

Quoted 11 lines

+\item Pause its operation except \field{device status} and preserve configurations in its Device Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space}

How do you Pause? For example, consider a link state register. You set

The device pauses itself.

SUSPEND, then link goes down. What is device supposed to do?

Once the device suspended, the device should not respond to the link_down until alive again.

what is link_down?
link goes down just by virtue of disconnecting it physically.

Quoted 5 lines

This is to preserve the device states, just record whatever it is when SUSPEND-ed. And process the signal when resume or alive at the destination side. At the destination it also needs a live announce which require an active link.

Quoted 8 lines

Record this somewhere internal but do not show it to driver? And how exactly will this hidden internal state be migrated since it is not visible?

May I know what kind of internal states?
This series migrates stateless devices, hard to define virtio-fs device context.

all devices have some state, none are completely stateless.

Quoted 51 lines

+\end{itemize}
+
\section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}

Each virtio device offers all the features it understands. During
@@ -99,10 +127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
\begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device type

-\item[24 to 42] Feature bits reserved for extensions to the queue and +\item[24 to 43] Feature bits reserved for extensions to the queue and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions. +\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

\begin{note}
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
\item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver to access its internal virtqueue state.

+ \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+ SUSPEND the device.

why is SUSPEND upper-case here?

will be lower in V3.

Thanks

+ See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
\end{description}

\drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Quoted 11 lines

Subscribe: [email protected]
Unsubscribe: [email protected] List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#27 lore raw

Re: [virtio-comment] Re: [PATCH V2 2/6] virtio: introduce SUSPEND bit in device status

Quoted 35 lines · Michael S. Tsirkin
Quoted 34 lines · Lingshan

On 11/6/2023 5:43 PM, Michael S. Tsirkin wrote:

On Fri, Nov 03, 2023 at 06:34:33PM +0800, Zhu Lingshan wrote:

This patch introduces a new status bit in the device status: SUSPEND.

This SUSPEND bit can be used by the driver to suspend a device, in order to stabilize the device states and virtqueue states.

Its main use case is live migration.

---
content.tex | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/content.tex b/content.tex
index 76813b5..bcc9d4b 100644
--- a/content.tex
+++ b/content.tex
@@ -49,6 +49,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev

\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced
an error from which it can't recover.
+
+\item[SUSPEND (16)] When VIRTIO_F_SUSPEND is negotiated, indicates that the
+ device has been suspended by the driver.
+

what does this mean?

Quoted 8 lines
Quoted 5 lines

When the driver sets SUSPEND and the device presents SUSPEND, means the device has been suspended by the driver.

Do you suggest to remove "When VIRTIO_F_SUSPEND is negotiated"

No I suggest explaining what does it mean that device has been suspended.

I will add "to stabilize the device states", is that OK?

Quoted 13 lines
Quoted 13 lines

\end{description}

The \field{device status} field starts out as 0, and is reinitialized to 0 by
@@ -73,6 +77,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
recover by issuing a reset.
\end{note}

+The driver SHOULD NOT set SUSPEND if FEATURES_OK is not set.
+
+When setting SUSPEND, the driver MUST re-read \field{device status} to ensure the SUSPEND bit is set. +

Quoted 4 lines
Quoted 3 lines

and if it's not?

Then the device may run into errors or just need longer time to suspend.

and then what does driver do?

I assume the driver should reset the device or give up the device.

Re-read is how we handle other status, like features_ok.

Quoted 4 lines
Quoted 3 lines

This is how we handle features_OK: "Re-read device status to ensure the FEATURES_OK bit is still set"

this is designed in case features are inconsistent.

I think this is designed to: 1) flush the device status 2) make sure the features are set.

Quoted 1 line

what kind of thing are you handling here?

The same purpose, to flush the status and make sure suspend is set. Once we make sure the device has been suspended, we can fetch the device states.

Quoted 2 lines

Also and then we bail out and retry with other feature set if not. what do we do here?

same as above, if the device is not suspended, like vqs still running, we can not fetch stable vq states. So we need to make sure it is set.

Quoted 35 lines
Quoted 15 lines

\devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field}

The device MUST NOT consume buffers or send any used buffer
@@ -82,6 +90,26 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
that a reset is needed. If DRIVER_OK is set, after it sets DEVICE_NEEDS_RESET, the device MUST send a device configuration change notification to the driver.

+The device MUST ignore SUSPEND if FEATURES_OK is not set.
+
+The device MUST ignore SUSPEND if VIRTIO_F_SUSPEND is not negotiated. +
+The device SHOULD allow settings to \field{device status} even when SUSPEND is set.

Quoted 4 lines

which settings?

any legit writing to the device status, like DRIVER_OK

that's not "settings" that's setting.

Quoted 14 lines

+
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set, the device SHOULD clear SUSPEND +and resumes operation upon DRIVER_OK.
+
+If VIRTIO_F_SUSPEND is negotiated, when the driver sets SUSPEND,
+the device SHOULD perform the following actions before presenting SUSPEND bit in the \field{device status}:
+
+\begin{itemize}
+\item Stop consuming buffers of any virtqueues and mark all finished descritors as used.

descritors? and what does finished mean?

Sorry my typo.

Quoted 8 lines
Quoted 5 lines

Finished means done processing it.

Like the spec words: When the device has finished a buffer, it writes the descriptor index into the used ring, and sends a used buffer notification.

only good for internal ring documentation - we did not want to say used because it's not used until used entry written. here just say used.

I am confused, by "here just say used", do you suggest we say:
"Stop consuming buffers of any virtqueues and mark all used descriptors as used."?

I am not a native speaker, and I am not sure this is better than finished

Quoted 32 lines
Quoted 32 lines

+\item Wait until all descriptors that being processed to finish and mark them as used.

descriptors are not marked used. buffers are.

that being -> that are being maybe?

Will fix

+\item Flush all used buffer and send used buffer notifications to the driver.

used buffers?

Here it means the buffer marked as used. shall I use finished buffer or any other suggestions?

what does Flush mean?

Flush means send all of them out. Like 5.19.7.1 Device Requirements: Device
Operation: Virtqueue flush

         +\item Record Virtqueue State of each enabled virtqueue, see section \ref{sec:Virtqueues / Virtqueue State}

     execpt that one unfortunately does not bother to say what does this mean
     :(
Quoted 7 lines
Quoted 5 lines

The virtqueue state has been defined in this series, in packed/split-ring.tex. And an PCI implementation of the interfaces is included.

Do you suggest any supplementary materials?

I suggest something that documents what it means unlike what is in this series.

How about: "Record Virtqueue State of each enabled virtqueue by the transport specific interfaces"?

Quoted 6 lines
Quoted 6 lines

+\item Pause its operation except \field{device status} and preserve configurations in its Device Configuration Space, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space}

How do you Pause? For example, consider a link state register. You set

Quoted 8 lines
Quoted 6 lines

The device pauses itself.

SUSPEND, then link goes down. What is device supposed to do?

Once the device suspended, the device should not respond to the link_down until alive again.

what is link_down?
link goes down just by virtue of disconnecting it physically.

To stabilize the device states, once suspended, even link down,
the device should not respond to it, this means:
1) if link down happens before suspend, the device detect and send an config interrupt.
2) if link down happens after suspend, the device should not respond to it.
3) if the device resume running, then detect link down and send an config interrupt.

Quoted 10 lines
Quoted 10 lines

This is to preserve the device states, just record whatever it is when SUSPEND-ed. And process the signal when resume or alive at the destination side. At the destination it also needs a live announce which require an active link.

Record this somewhere internal but do not show it to driver? And how exactly will this hidden internal state be migrated since it is not visible?

Quoted 5 lines
Quoted 4 lines

May I know what kind of internal states?
This series migrates stateless devices, hard to define virtio-fs device context.

all devices have some state, none are completely stateless.

Some of the states can be read from config space, hypervisor can migrate them for sure. Others like virtio-fs are hard to define for now, but we still need to make progress in live migration.

Quoted 63 lines
Quoted 63 lines

+\end{itemize}
+
\section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits}

Each virtio device offers all the features it understands. During
@@ -99,10 +127,10 @@ \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature B
\begin{description}
\item[0 to 23, and 50 to 127] Feature bits for the specific device type

-\item[24 to 42] Feature bits reserved for extensions to the queue and +\item[24 to 43] Feature bits reserved for extensions to the queue and
feature negotiation mechanisms

-\item[43 to 49, and 128 and above] Feature bits reserved for future extensions. +\item[44 to 49, and 128 and above] Feature bits reserved for future extensions.
\end{description}

\begin{note}
@@ -875,6 +903,10 @@ \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
\item[VIRTIO_F_QUEUE_STATE(42)] This feature indicates that the device allows the driver to access its internal virtqueue state.

+ \item[VIRTIO_F_SUSPEND(43)] This feature indicates that the driver can
+ SUSPEND the device.

why is SUSPEND upper-case here?

will be lower in V3.

Thanks

+ See \ref{sec:Basic Facilities of a Virtio Device / Device Status Field}.
+
\end{description}

\drivernormative{\section}{Reserved Feature Bits}{Reserved Feature Bits}
--
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe:[email protected] Unsubscribe:[email protected] List help:[email protected]
List archive:https://lists.oasis-open.org/archives/virtio-comment/ Feedback License:https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines:https://www.oasis-open.org/policies-guidelines/mailing-lists Committee:https://www.oasis-open.org/committees/virtio/
Join OASIS:https://www.oasis-open.org/join/

#28 lore raw

PATCH v2 3/6 virtio: dont reset vqs when SUSPEND

In reply to Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
 content.tex | 3 +++
 1 file changed, 3 insertions(+)
content.tex +3 -0
index bcc9d4b..060b5c2 100644
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /
 The device MUST reset any state of a virtqueue to the default state,
 including the available state and the used state.
 
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in \field{device status},
+the driver SHOULD NOT reset any virtqueues.
+
 \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 
 After the driver tells the device to reset a queue, the driver MUST verify that
Signature · 18 lines
2.35.3


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#29 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 14 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
 content.tex | 3 +++
 1 file changed, 3 insertions(+)
content.tex +0 -0
index bcc9d4b..060b5c2 100644

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device / · line 452

Quoted 9 lines
content.tex +3 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /
 The device MUST reset any state of a virtqueue to the default state,
 including the available state and the used state.
 
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in \field{device status},
+the driver SHOULD NOT reset any virtqueues.
+
 \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 
 After the driver tells the device to reset a queue, the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

Quoted 2 lines
Signature · 1 line
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#30 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 18 lines · Michael S. Tsirkin
Quoted 17 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
  content.tex | 3 +++
  1 file changed, 3 insertions(+)
content.tex +0 -0
index bcc9d4b..060b5c2 100644
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /
  The device MUST reset any state of a virtqueue to the default state,
  including the available state and the used state.
 
Quoted 8 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device / · line 452

Quoted 6 lines
content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in \field{device status},
+the driver SHOULD NOT reset any virtqueues.
+
  \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
 
  After the driver tells the device to reset a queue, the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Quoted 5 lines
Quoted 5 lines
Signature · 2 lines
-- 
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#31 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 27 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
  content.tex | 3 +++
  1 file changed, 3 insertions(+)
Quoted 14 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device / · line 450

Quoted 12 lines
content.tex +3 -0
index bcc9d4b..060b5c2 100644
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /
  The device MUST reset any state of a virtqueue to the default state,
  including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in \field{device status},
+the driver SHOULD NOT reset any virtqueues.
+
  \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
  After the driver tells the device to reset a queue, the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

Quoted 2 lines

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Signature · 2 lines
-- 
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#32 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · Lingshan
Quoted 24 lines · Michael S. Tsirkin
Quoted 14 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
content.tex +0 -0
index bcc9d4b..060b5c2 100644

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device / · line 450

Quoted 7 lines
content.tex +3 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /
   The device MUST reset any state of a virtqueue to the default state,
   including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in \field{device status},
+the driver SHOULD NOT reset any virtqueues.
+
   \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}
   After the driver tells the device to reset a queue, the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

Quoted 4 lines
Quoted 2 lines

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration. This can also be used for debugging I think.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Signature · 2 lines
-- 
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#33 lore raw

[virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 35 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic

Quoted 5 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /

Quoted 6 lines
content.tex +3 -0
   The device MUST reset any state of a virtqueue to the default state,
   including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
   \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
content.tex +0 -0
   After the driver tells the device to reset a queue, the driver

MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped. So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

So if you can please take a look if the proposed admin command to freeze/stop mode can be used in the emulated register case or not. It helps to have the suspend bit in guest control as well with/without emulation mode.

Quoted 1 line

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead of in-band.

#34 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 35 lines · Parav Pandit
Quoted 35 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
    content.tex | 3 +++
    1 file changed, 3 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic

Quoted 5 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /

Quoted 6 lines
content.tex +3 -0
    The device MUST reset any state of a virtqueue to the default state,
    including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
    \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
content.tex +0 -0
    After the driver tells the device to reset a queue, the driver

MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained, and what about MMIO and CCW? This should be a basic facility.

Quoted 5 lines

In that case if there is suspend the device available, it will be used by the guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped. So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

The guest can eve reset the device.

Quoted 3 lines

So if you can please take a look if the proposed admin command to freeze/stop mode can be used in the emulated register case or not. It helps to have the suspend bit in guest control as well with/without emulation mode.

Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these enough.

As explained before, freeze/stop the device by PCI is a layer violation.

And device status can be pass-through(without emulation, just map it to guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

Quoted 3 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead of in-band.

re-using another facility without extra efforts is not a bad thing anyway.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#35 lore raw

[virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 39 lines · Parav Pandit
Quoted 39 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
    content.tex | 3 +++
    1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The device MUST reset any state of a virtqueue to the default state, including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
    \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI PM interface should suspend/resume the device on D0<->D3 state transitions.

Quoted 1 line

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport needs to evolve. Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will continue wider use.

Quoted 1 line

This should be a basic facility.

Other transport can also offer like PCI.

Quoted 7 lines
Quoted 2 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines

The guest can eve reset the device.

Quoted 2 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 1 line

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these enough.

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the migration framework.

Quoted 4 lines

And device status can be pass-through(without emulation, just map it to guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the guest resets the device, hypervisor has lost the control of migration context etc. Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

#36 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 43 lines · Parav Pandit
Quoted 43 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 39 lines · Parav Pandit
Quoted 39 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
     content.tex | 3 +++
     1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The device MUST reset any state of a virtqueue to the default state, including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
     \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI PM interface should suspend/resume the device on D0<->D3 state transitions.

Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

Quoted 3 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport needs to evolve.

I am not sure CCW and MMIO maintainers want to hear this.

Quoted 1 line

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will continue wider use.

you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

Quoted 3 lines
Quoted 2 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Quoted 15 lines
Quoted 7 lines
Quoted 2 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines

The guest can eve reset the device.

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 1 line

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these enough.

Quoted 8 lines

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the migration framework.

I think I have explained, virito builds on other transport and it should be self-contained, so far so good.

Quoted 8 lines
Quoted 4 lines

And device status can be pass-through(without emulation, just map it to guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the guest resets the device, hypervisor has lost the control of migration context etc. Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#37 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 55 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

Quoted 20 lines · Parav Pandit
Quoted 20 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
     content.tex | 3 +++
     1 file changed, 3 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
     \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Quoted 1 line

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines
Quoted 8 lines

The guest can eve reset the device.

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

Quoted 4 lines
Quoted 1 line

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

Quoted 7 lines
Quoted 1 line

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Quoted 3 lines

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

#38 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 56 lines · Parav Pandit
Quoted 56 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

Quoted 20 lines · Parav Pandit
Quoted 20 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
      content.tex | 3 +++
      1 file changed, 3 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
      \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a layer volition, this is a fact, right?

Quoted 3 lines

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Again, virtio should be self-contained, not layer volited, for example, we reset virito devices by writing 0 to device status, not by PCI FLR.

Quoted 10 lines
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Quoted 1 line

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to the guest, so we should suspend the guest first, then suspend the device(by host).

Quoted 3 lines

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

The time cost is reasonable in O(N) no matter how you suspend/resume the device.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Quoted 7 lines

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

So these features are even not planned, so don't depend on them.

Quoted 21 lines
Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines
Quoted 8 lines

The guest can eve reset the device.

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

Quoted 4 lines

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 5 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Quoted 3 lines

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

Quoted 8 lines
Quoted 2 lines

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

as explained above, when live migration, the guest should be suspended first, at this point, the host owns the device, it has access to the device.

Quoted 11 lines
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#39 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 69 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 16, 2023 3:40 PM

Quoted 32 lines · Parav Pandit
Quoted 32 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

Quoted 27 lines · Parav Pandit
Quoted 27 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 23 lines · Parav Pandit
Quoted 23 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
      content.tex | 3 +++
      1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The device MUST reset any state of a virtqueue to the
default

state,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any

virtqueues.

Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state

Quoted 8 lines

transitions.

Quoted 2 lines
Quoted 2 lines

Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a

device, not by PCI.

Quoted 2 lines

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a layer volition, this is a fact, right?

I don’t see PCI PM as any layer violation. It is used by hundreds of industry devices. You might want to ask PCI-SIG to eliminate PCI PM and get their feedback.

Quoted 6 lines
Quoted 3 lines

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include

new suspend bit.
Again, virtio should be self-contained, not layer volited, for example, we reset virito devices by writing 0 to device status, not by PCI FLR.

It is not for layer adherence or layer violation purpose.

It exists because it gives much flexibility in device implementation to not depend on FLR or PM timings.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Quoted 2 lines

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

Quoted 6 lines
Quoted 1 line

I want to emphasize that I am not against the suspend bit as long as it is guest

driver controlled without interfering the device migration flow (like rest of the state).
When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to the guest, so we should suspend the guest first, then suspend the device(by host).

This miss the fundamental point that I explained in the first paragraph of theory of operation. I.e. hypervisor administers the device even when the guest is running.
This is the usually referreed as pre-copy phase.
During this stage large part of the device context read and write is done on src and dst hypervisor respectively. This cuts down majority of the downtime.

Quoted 7 lines
Quoted 2 lines

The practical reason for suspending functionality under guest control is, that

resuming/suspending the large device can take time.

Quoted 1 line

So let it be in guest driver control. No need to muddy with device migration

flow.
The time cost is reasonable in O(N) no matter how you suspend/resume the device.

In the proposed approach using admin commands, it is nearly O(1) for N devices and M queues per each.

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI

Quoted 8 lines

nor MMIO".

Quoted 2 lines

And I also read, "The IBM System/390 is a discontinued mainframe product

family implementing".

Quoted 3 lines

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

So these features are even not planned, so don't depend on them.

My series does not depend on ccw or mmio.
Not sure what you mean by don’t depend on them.

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

The guest can eve reset the device.

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

Quoted 9 lines

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Not sure what you mean not bind to any.

Virtio objects has transport binding such as pci for driver notifications, device config, q enable etc.

Quoted 15 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context

etc.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the

Quoted 8 lines

channel as hypervisor is not involved in trap+emulation.

Quoted 5 lines

So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

as explained above, when live migration, the guest should be suspended first, at this point, the host owns the device, it has access to the device.

This is the missing piece for you for a long time.
The proposed admin command approach, the guest is not suspend first and accessed by the hypervisor.

Think of this as PML for device context... (just for analogy purpose).

Quoted 13 lines
Quoted 11 lines
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

#40 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Zhu, Lingshan
Quoted 62 lines · Lingshan
Quoted 59 lines · Parav Pandit
Quoted 59 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

Quoted 20 lines · Parav Pandit
Quoted 20 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
      content.tex | 3 +++
      1 file changed, 3 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
      \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a
layer volition, this is a fact, right?

Not really. Look at the charter - when available we should use platform capabilities because it makes it easier to write drivers.

Quoted 5 lines
Quoted 2 lines

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Again, virtio should be self-contained, not layer volited, for example, we reset virito devices
by writing 0 to device status, not by PCI FLR.

There are some advantage to doing it like this, e.g. one does not need to save and restore config space. What are advatages of suspend via this bit?

Quoted 15 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Quoted 1 line

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to
the guest, so we should suspend the guest first, then suspend the device(by host).

Quoted 1 line
Quoted 4 lines
Quoted 2 lines

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

The time cost is reasonable in O(N) no matter how you suspend/resume the device.

Very much depends. Big O notation can be misleading. If you have to repeat an operation 1000 times that's 1000 * N and suddenly you are going from milliseconds to seconds.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Quoted 8 lines
Quoted 7 lines

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

So these features are even not planned, so don't depend on them.

But again can one suspend ccw device? If you are adding this feature and claiming it's supported for all transports you better find out what does it do.

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines
Quoted 8 lines

The guest can eve reset the device.

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

Quoted 8 lines

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Binding is an OS specific thing, but e.g. under Linux transport drivers bind to devices then virtio drivers bind to virtio bus. No binding -> nothing works.

Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

Quoted 7 lines
Quoted 1 line

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Quoted 3 lines

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Quoted 6 lines
Quoted 3 lines

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

as explained above, when live migration, the guest should be suspended first, at this point,
the host owns the device, it has access to the device.

Where do you say this in the spec patch?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

That's vague. What does it mean exactly and what happens if some external event causes state change?

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#41 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 64 lines · Michael S. Tsirkin
Quoted 63 lines · Lingshan
Quoted 61 lines · Parav Pandit
Quoted 61 lines

From: Zhu, Lingshan<[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

Quoted 20 lines · Parav Pandit
Quoted 20 lines

From: Zhu, Lingshan<[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: Zhu, Lingshan<[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
       content.tex | 3 +++
       1 file changed, 3 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
       \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a
layer volition, this is a fact, right?

Not really. Look at the charter - when available we should use platform capabilities because it makes it easier to write drivers.

I think that is transport specific implementation, for example pci common cfg.

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Again, virtio should be self-contained, not layer volited, for example, we reset virito devices
by writing 0 to device status, not by PCI FLR.

There are some advantage to doing it like this, e.g. one does not need to save and restore config space. What are advatages of suspend via this bit?

suspend a device by the device status is the same as how we enable a virito device.

Doing this by PCI is clearly a layer volition, and does not work for other transports.

Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Quoted 1 line

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to
the guest, so we should suspend the guest first, then suspend the device(by host).

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

The time cost is reasonable in O(N) no matter how you suspend/resume the device.

Very much depends. Big O notation can be misleading. If you have to repeat an operation 1000 times that's 1000 * N and suddenly you are going from milliseconds to seconds.

I mean enable 100 queues cost more time then enable 1 vq no matter how we enable it. that is O(N)

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

So these features are even not planned, so don't depend on them.

But again can one suspend ccw device? If you are adding this feature and claiming it's supported for all transports you better find out what does it do.

I am not an expert on CCW, anything block we suspend a CCW device by this bit? This seems only controlled by the device itself.

Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines
Quoted 8 lines

The guest can eve reset the device.

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

Quoted 8 lines

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

Quoted 1 line

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Binding is an OS specific thing, but e.g. under Linux transport drivers bind to devices then virtio drivers bind to virtio bus. No binding -> nothing works.

I think general facilities are better not only work on a specific transport

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

Quoted 7 lines
Quoted 1 line

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Quoted 3 lines

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

as explained above, when live migration, the guest should be suspended first, at this point,
the host owns the device, it has access to the device.

Where do you say this in the spec patch?

VM live migration is not in this spec.
If we suspend the device first, then the guest may detect IO errors.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

That's vague. What does it mean exactly and what happens if some external event causes state change?

it is suspended, somehow like powered-down, so it should not respond to the events until resume.

Quoted 1 line
#42 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 152 lines · Lingshan

On 11/16/2023 8:09 PM, Michael S. Tsirkin wrote:

On Thu, Nov 16, 2023 at 06:09:38PM +0800, Zhu, Lingshan wrote:

On 11/16/2023 1:35 AM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

On 11/10/2023 2:31 PM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

On 11/9/2023 6:15 PM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

On 11/9/2023 1:46 AM, Michael S. Tsirkin wrote:

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu, Lingshan wrote:

On 11/6/2023 5:49 PM, Michael S. Tsirkin wrote:

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu Lingshan wrote:

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
content.tex | 3 +++ 1 file changed, 3 insertions(+)

diff --git a/content.tex b/content.tex index bcc9d4b..060b5c2 100644
--- a/content.tex
+++ b/content.tex
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic

Facilities of a Virtio Device /

The device MUST reset any state of a virtqueue to the default

state,

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any virtqueues. +
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a
layer volition, this is a fact, right?

Not really. Look at the charter - when available we should use platform capabilities because it makes it easier to write drivers.

I think that is transport specific implementation, for example pci common cfg.

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Again, virtio should be self-contained, not layer volited, for example, we reset virito devices
by writing 0 to device status, not by PCI FLR.

There are some advantage to doing it like this, e.g. one does not need to save and restore config space. What are advatages of suspend via this bit?

suspend a device by the device status is the same as how we enable a virito device.

Doing this by PCI is clearly a layer volition, and does not work for other transports.

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to
the guest, so we should suspend the guest first, then suspend the device(by host).

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

The time cost is reasonable in O(N) no matter how you suspend/resume the device.

Quoted 6 lines

Very much depends. Big O notation can be misleading. If you have to repeat an operation 1000 times that's 1000 * N and suddenly you are going from milliseconds to seconds.

I mean enable 100 queues cost more time then enable 1 vq no matter how we enable it. that is O(N)

Depends on what "that" is. Number of VM exits does not have to be O(N), you can pass these 100 queues in memory.

Quoted 18 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

Quoted 7 lines

So these features are even not planned, so don't depend on them.

But again can one suspend ccw device? If you are adding this feature and claiming it's supported for all transports you better find out what does it do.

I am not an expert on CCW, anything block we suspend a CCW device by this bit?

I don't think CCW supports suspend at all.

Quoted 2 lines

This seems only controlled by the device itself.

And? What it the point of suspending only the device if rest of system is still going?

Quoted 44 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

The guest can eve reset the device.

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

Quoted 8 lines

virtio is built on some transports, but not bind to any.

Binding is an OS specific thing, but e.g. under Linux transport drivers bind to devices then virtio drivers bind to virtio bus. No binding -> nothing works.

I think general facilities are better not only work on a specific transport

But platform facilities are even better we don't need to work on them at all.

Quoted 24 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

Quoted 7 lines

as explained above, when live migration, the guest should be suspended first, at this point,
the host owns the device, it has access to the device.

Where do you say this in the spec patch?

VM live migration is not in this spec.

Then it should be.

Quoted 2 lines

If we suspend the device first, then the guest may detect IO errors.

That's bad. So you need to tell driver what not to do so as not to get errors.

Quoted 18 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

Quoted 8 lines

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

That's vague. What does it mean exactly and what happens if some external event causes state change?

it is suspended, somehow like powered-down, so it should not respond to the events until resume.

"somehow" is too vague for the spec.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#43 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 152 lines · Michael S. Tsirkin
Quoted 151 lines · Lingshan

On 11/16/2023 8:09 PM, Michael S. Tsirkin wrote:

On Thu, Nov 16, 2023 at 06:09:38PM +0800, Zhu, Lingshan wrote:

On 11/16/2023 1:35 AM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 13, 2023 2:53 PM

On 11/10/2023 2:31 PM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 11:52 AM

On 11/9/2023 6:15 PM, Parav Pandit wrote:

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

On 11/9/2023 1:46 AM, Michael S. Tsirkin wrote:

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu, Lingshan wrote:

On 11/6/2023 5:49 PM, Michael S. Tsirkin wrote:

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu Lingshan wrote:

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
content.tex | 3 +++ 1 file changed, 3 insertions(+)

diff --git a/content.tex b/content.tex index bcc9d4b..060b5c2 100644
--- a/content.tex
+++ b/content.tex
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic

Facilities of a Virtio Device /

The device MUST reset any state of a virtqueue to the default

state,

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any virtqueues. +
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device? For large device I could imagine it could be short.

As you see, PCI PM, so this is a layer violation, virtio should be self contained,

If you think it is layer violation, than suspend bit for sure is not needed. PCI

PM interface should suspend/resume the device on D0<->D3 state transitions. Doesn't make sense logically, because it is layer violation, so you want it to be worse? For example, virito writes 0 to device status to reset a device, not by PCI.

All these layer violation thing is just abstract to me. Your argument contradicts with your fellow author and yourself.

I don't see how, we keep telling you virtio should be self contained, and suspend by PCI PM is a
layer volition, this is a fact, right?

Not really. Look at the charter - when available we should use platform capabilities because it makes it easier to write drivers.

I think that is transport specific implementation, for example pci common cfg.

I don’t want to make it worse.
If you think its layer violation, just depend on the PCI PM, no need to include new suspend bit.

Again, virtio should be self-contained, not layer volited, for example, we reset virito devices
by writing 0 to device status, not by PCI FLR.

There are some advantage to doing it like this, e.g. one does not need to save and restore config space. What are advatages of suspend via this bit?

suspend a device by the device status is the same as how we enable a virito device.

Doing this by PCI is clearly a layer volition, and does not work for other transports.

and what about MMIO and CCW?

They have largely lacked the richness of PCI transport. So those transport

needs to evolve.
I am not sure CCW and MMIO maintainers want to hear this.

Otherwise, PCI offers rich transport facilities compared to MMIO, hence, it will

continue wider use.
you know this SUSPEND bit work fine on all transport, right? Because device_status is transport independent.

I want to emphasize that I am not against the suspend bit as long as it is guest driver controlled without interfering the device migration flow (like rest of the state).

When migrate a device, it is the host who suspends the device. The reason is the live migration process should be transparent to
the guest, so we should suspend the guest first, then suspend the device(by host).

The practical reason for suspending functionality under guest control is, that resuming/suspending the large device can take time. So let it be in guest driver control. No need to muddy with device migration flow.

The time cost is reasonable in O(N) no matter how you suspend/resume the device.

Quoted 8 lines
Quoted 6 lines

Very much depends. Big O notation can be misleading. If you have to repeat an operation 1000 times that's 1000 * N and suddenly you are going from milliseconds to seconds.

I mean enable 100 queues cost more time then enable 1 vq no matter how we enable it. that is O(N)

Depends on what "that" is. Number of VM exits does not have to be O(N), you can pass these 100 queues in memory.

For batching, yest. But I don't see this as a problem because we enable vqs by this way for many years, so far so good.

Quoted 19 lines
Quoted 19 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

Quoted 8 lines
Quoted 7 lines

So these features are even not planned, so don't depend on them.

But again can one suspend ccw device? If you are adding this feature and claiming it's supported for all transports you better find out what does it do.

I am not an expert on CCW, anything block we suspend a CCW device by this bit?

I don't think CCW supports suspend at all.

I think it is not a transport feature but a device feature, the device can always suspend it self, like don't process data and stop responding until a specific signal.

Quoted 5 lines
Quoted 3 lines

This seems only controlled by the device itself.

And? What it the point of suspending only the device if rest of system is still going?

That is an orchestration issue, totally up to the administrators. Normally when suspending the device, the guest are very likely to be suspended already.

Quoted 46 lines
Quoted 46 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

The guest can eve reset the device.

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Quoted 8 lines
Quoted 6 lines

Binding is an OS specific thing, but e.g. under Linux transport drivers bind to devices then virtio drivers bind to virtio bus. No binding -> nothing works.

I think general facilities are better not only work on a specific transport

But platform facilities are even better we don't need to work on them at all.

Yes, so I also agree to track dirty pages by the platform, on-CPU dirty page tracking facilities serving all transport, not only PCI.

Quoted 31 lines
Quoted 31 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

as explained above, when live migration, the guest should be suspended first, at this point,
the host owns the device, it has access to the device.

Where do you say this in the spec patch?

Quoted 7 lines
Quoted 1 line

VM live migration is not in this spec.

Then it should be.

Quoted 2 lines

If we suspend the device first, then the guest may detect IO errors.

That's bad. So you need to tell driver what not to do so as not to get errors.

I think the process should be suspending the guest first, then the host owns the device, so it can suspend the guest and collect the necessary data for live migration.

Quoted 21 lines
Quoted 21 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

Quoted 6 lines
Quoted 5 lines

That's vague. What does it mean exactly and what happens if some external event causes state change?

it is suspended, somehow like powered-down, so it should not respond to the events until resume.

"somehow" is too vague for the spec.

Yeah, in spec, we have a section to describe what the device should do when SUSPEND.

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#44 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 6 lines · Lingshan
Quoted 4 lines
Quoted 2 lines

I mean enable 100 queues cost more time then enable 1 vq no matter how we enable it. that is O(N)

Depends on what "that" is. Number of VM exits does not have to be O(N), you can pass these 100 queues in memory.

For batching, yest. But I don't see this as a problem because we enable vqs by this way for many years, so far so good.

Well boot time is less contrained than migration time because it often involves a ton of IO to load guest software.

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

This should be a basic facility.

Other transport can also offer like PCI.

Do you want to work for these transport? Implementing the new features as PCI?

Not presently as PCI as more features than rest of the two.
What I read about ccw is: " S/390 based virtual machines support neither PCI nor MMIO".

And I also read, "The IBM System/390 is a discontinued mainframe product family implementing".

So I don’t know who needs to extend ccw.
And if one needs, those maintainers will extend it to match to PCI standard.

So these features are even not planned, so don't depend on them.

But again can one suspend ccw device? If you are adding this feature and claiming it's supported for all transports you better find out what does it do.

Quoted 5 lines
Quoted 2 lines
Quoted 1 line

I am not an expert on CCW, anything block we suspend a CCW device by this bit?

I don't think CCW supports suspend at all.

I think it is not a transport feature but a device feature, the device can always suspend it self, like don't process data and stop responding until a specific signal.

If guest keeps going but device just stop then guest has a decent chance to crash.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This seems only controlled by the device itself.

And? What it the point of suspending only the device if rest of system is still going?

That is an orchestration issue, totally up to the administrators. Normally when suspending the device, the guest are very likely to be suspended already.

If you need an orchestration system to suspend your laptop or your phone things are very bad indeed.

Quoted 50 lines
Quoted 50 lines
Quoted 50 lines

In that case if there is suspend the device available, it will be used by the

guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

The guest can eve reset the device.

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

It helps to have the suspend bit in guest control as well with/without

emulation mode.
Parav, please believe I have read your series, I didn't comment there because I want to avoid further conflicts/debating, we have done these

enough.

I believe the series posted in v3 can support vdpa use case as well. So I will progress to post v4.

As explained before, freeze/stop the device by PCI is a layer violation.

I am afraid, we have different vision.
I don’t see any layer violation.
Suspend is enough in the PCI PM.
Our vision is more aligned with rest of the hypervisor knobs that owns the

migration framework.
I think I have explained, virito builds on other transport and it should be self- contained, so far so good.

Virtio without any transport binding is just blank paper discussion.

virtio is built on some transports, but not bind to any.

Binding is an OS specific thing, but e.g. under Linux transport drivers bind to devices then virtio drivers bind to virtio bus. No binding -> nothing works.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I think general facilities are better not only work on a specific transport

But platform facilities are even better we don't need to work on them at all.

Yes, so I also agree to track dirty pages by the platform, on-CPU dirty page tracking facilities serving all transport, not only PCI.

If available. Both you and Parav should stop just repeating your preference and start showing some actual info on which systems support this platform tracking, how recent they have to be, are all of server/desktop/mobile covered, etc.

Quoted 34 lines
Quoted 34 lines
Quoted 25 lines

And device status can be pass-through(without emulation, just map it to
guest) to the guest or trapped(trap and emulate by the hypervisor, for example set_status in vDPA).

When it is pass-through, it is controlled by the guest, so for example, if the

guest resets the device, hypervisor has lost the control of migration context etc.

Hence, hypervisor needs a channel which is not guest owned.

Same channel can work when trap+emulation is done.

It is the guest owns the device, it can reset the device, once reset, the device context are cleared.

Hypervisor do not have the ability to read/write the device context. It lost the channel as hypervisor is not involved in trap+emulation. So it is not helpful in one use case.

Admin commands can work even with trap+emulation mode.

What is missing, that should be added?

Quoted 7 lines

as explained above, when live migration, the guest should be suspended first, at this point,
the host owns the device, it has access to the device.

Where do you say this in the spec patch?

VM live migration is not in this spec.

Then it should be.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

If we suspend the device first, then the guest may detect IO errors.

That's bad. So you need to tell driver what not to do so as not to get errors.

I think the process should be suspending the guest first, then the host owns the device, so it can suspend the guest and collect the necessary data for live migration.

So you need to say what is and what is not allowed. Because in your model, device has no idea whether it's host or guest accessing it and so you can not just say "don't access device at all". And this by the way is a big plus in Parav's approach - since host uses a distinct channel for state retrieval it is possible to simply say "don't access device" and we are done.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.
re-using another facility without extra efforts is not a bad thing anyway.

I just don’t see how a suspend bit some debug feature. Almost everything with that regard is a debug feature to me.

suspend then check the device states?

You already suspended the device, so device state is already changed. All debug information is changed, so not useful now.

When suspended, the device should keep and stabilize its device states, at least in my series it should behave like this.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

That's vague. What does it mean exactly and what happens if some external event causes state change?

it is suspended, somehow like powered-down, so it should not respond to the events until resume.

"somehow" is too vague for the spec.

Yeah, in spec, we have a section to describe what the device should do when SUSPEND.

Quoted 1 line

maybe I missed it. generally I think the whole SUSPEND feature should be in one patch, no real reason to split it up. queue state thing is a different matter.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#45 lore raw

[virtio-comment] Re: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Parav Pandit
Quoted 38 lines · Parav Pandit
Quoted 38 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic

Quoted 5 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

content.tex \subsubsection{Virtqueue Reset}\label{sec:Basic Facilities of a Virtio Device /

Quoted 6 lines
content.tex +3 -0
   The device MUST reset any state of a virtqueue to the default state,
   including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
   \drivernormative{\paragraph}{Virtqueue Reset}{Basic Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
content.tex +0 -0
   After the driver tells the device to reset a queue, the driver

MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest driver itself, hypervisor wouldn’t know about it when those registers are not trapped. So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 2 lines

So if you can please take a look if the proposed admin command to freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered yourself that PM is the right way to go.

Quoted 1 line

It helps to have the suspend bit in guest control as well with/without emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

Quoted 4 lines
Quoted 2 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of-band facilities are often dangerous and usually prohibited or even unsupported.

Thanks

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#46 lore raw

[virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 48 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

Quoted 42 lines · Parav Pandit
Quoted 42 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The device MUST reset any state of a virtqueue to the default state, including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
   \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some sort of its own reset mechanism.

Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make sense.

Quoted 4 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

Hypervisor needs its channel to suspend the device, as fundamentally guest is unaware of device migration flow.

Quoted 5 lines
Quoted 3 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 8 lines
Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Quoted 8 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 2 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 7 lines

yourself that PM is the right way to go.

Quoted 1 line

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.
If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it as transport, And that would be just sub-optimal for actual working.
And hence, I wouldn’t call it a transport anymore.

Quoted 11 lines
Quoted 5 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous and usually prohibited or even unsupported.

Guest driver can always read and write the device status without adding a suspend bit.

#47 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 59 lines · Parav Pandit
Quoted 49 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

Quoted 42 lines · Parav Pandit
Quoted 42 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
content.tex index bcc9d4b..060b5c2 renamed from content.tex +0 -0

100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The device MUST reset any state of a virtqueue to the default state, including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in
+\field{device status}, the driver SHOULD NOT reset any virtqueues.
+
   \drivernormative{\paragraph}{Virtqueue Reset}{Basic

Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I think.

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some sort of its own reset mechanism.

Quoted 7 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make sense.

Why, device status (e.g reset) belongs to that part.

Quoted 6 lines
Quoted 5 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

Quoted 2 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one for reset as well.

Quoted 10 lines
Quoted 10 lines
Quoted 4 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Quoted 12 lines
Quoted 9 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 2 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 8 lines
Quoted 7 lines

yourself that PM is the right way to go.

Quoted 1 line

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 2 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

Quoted 6 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

This can also be used for debugging I think.

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous and usually prohibited or even unsupported.

Guest driver can always read and write the device status without adding a suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

Thanks

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#48 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 70 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

Quoted 34 lines · Parav Pandit
Quoted 34 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

Quoted 27 lines · Parav Pandit
Quoted 27 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
content.tex index renamed from content.tex +0 -0

bcc9d4b..060b5c2
100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any

virtqueues.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 3 lines
Quoted 3 lines

Suspending at different layers like rest at different layers.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make sense.

Why, device status (e.g reset) belongs to that part.

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

Quoted 10 lines
Quoted 6 lines
Quoted 5 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is not applicable. D3hot is controlled by the driver.

Quoted 7 lines
Quoted 2 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one for reset as well.

I don’t see a need for hypervisor to reset the device in passthrough mode. Can you explain why is it needed?
Do you mean, it is needed in vdpa mode? If yes, the registers are emulated anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 23 lines
Quoted 15 lines
Quoted 10 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 2 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

Quoted 9 lines

See above and the discussion in another thread.

Quoted 2 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to transport notifications via virtqueue.

Quoted 14 lines
Quoted 14 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 12 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

Quoted 6 lines

and usually prohibited or even unsupported.

Quoted 1 line

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got changed.

I just don’t see that suspend is a debug tool. Every feature is a debug feature literally. Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate changed for debugging. One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug..
The list continues..

Quoted 4 lines

Thanks

Quoted 1 line
#49 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 68 lines · Parav Pandit
Quoted 68 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

Quoted 31 lines · Parav Pandit
Quoted 31 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

Quoted 25 lines · Parav Pandit
Quoted 25 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 12 lines · Michael S. Tsirkin
Quoted 11 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
    content.tex | 3 +++
    1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
content.tex index renamed from content.tex +0 -0

bcc9d4b..060b5c2
100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any

virtqueues.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 5 lines
Quoted 5 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

That's it.

Sure, but wrapping it under some "basic facility" is just does not make sense.

Why, device status (e.g reset) belongs to that part.

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

I said live migration is a use-case of the SUSPEND bit. I did not say the SUSPEND bit is only for live migration.

Quoted 88 lines
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is not applicable. D3hot is controlled by the driver.

Quoted 6 lines
Quoted 1 line

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one for reset as well.

I don’t see a need for hypervisor to reset the device in passthrough mode. Can you explain why is it needed?
Do you mean, it is needed in vdpa mode? If yes, the registers are emulated anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 20 lines
Quoted 13 lines
Quoted 8 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 1 line

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

Quoted 9 lines

See above and the discussion in another thread.

Quoted 2 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to transport notifications via virtqueue.

Quoted 11 lines
Quoted 11 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

Quoted 6 lines

and usually prohibited or even unsupported.

Quoted 1 line

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got changed.

Quoted 10 lines

I just don’t see that suspend is a debug tool. Every feature is a debug feature literally. Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate changed for debugging. One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug..
The list continues..

Quoted 2 lines

Thanks

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#50 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Parav Pandit
Quoted 74 lines · Parav Pandit
Quoted 74 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

Quoted 34 lines · Parav Pandit
Quoted 34 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

Quoted 27 lines · Parav Pandit
Quoted 27 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Lingshan
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Zhu Lingshan

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
content.tex index renamed from content.tex +0 -0

bcc9d4b..060b5c2
100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The device MUST reset any state of a virtqueue to the default

state,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set in +\field{device status}, the driver SHOULD NOT reset any

virtqueues.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue, the
driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 6 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

That's it.

Sure, but wrapping it under some "basic facility" is just does not make sense.

Why, device status (e.g reset) belongs to that part.

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is not applicable.

Have you seen the link I give you? Even if you are right, there still could be such a request from the firmware, no?

Quoted 1 line

D3hot is controlled by the driver.

So, it requires the device context to be preserved, which is not documented in your patch.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one for reset as well.

I don’t see a need for hypervisor to reset the device in passthrough mode. Can you explain why is it needed?

Qemu has a command "system_reset".

Quoted 49 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 25 lines
Quoted 15 lines
Quoted 10 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 2 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

Quoted 16 lines
Quoted 16 lines
Quoted 15 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 12 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

and usually prohibited or even unsupported.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got changed.

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 7 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate changed for debugging. One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug..
The list continues..

Let's not shift concepts.

Obviously, suspend is not the only way to debug. But that's not the context here.

Thanks

Quoted 6 lines
Quoted 5 lines

Thanks

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#51 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 94 lines

From: Jason Wang <[email protected]>
Sent: Tuesday, November 21, 2023 1:03 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

On Thu, Nov 16, 2023 at 1:39 AM Parav Pandit <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

On Thu, Nov 9, 2023 at 6:16 PM Parav Pandit <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 1 line · Michael S. Tsirkin

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu, Lingshan

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu Lingshan

Quoted 52 lines · wrote:
Quoted 52 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
content.tex index renamed from content.tex +0 -0

bcc9d4b..060b5c2
100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The device MUST reset any state of a virtqueue to
the default

state,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

content.tex

Quoted 4 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set
+in \field{device status}, the driver SHOULD NOT reset
+any

virtqueues.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue,
the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make

sense.

Quoted 3 lines
Quoted 3 lines

Why, device status (e.g reset) belongs to that part.

Quoted 7 lines
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line

Instead of claiming it as some non_device_migration facility does not make

sense.

It is used for migration for sure.

This is why it is not working when device is directly mapped.
The hypervisor messing this bit and guest is also doing power management with it.

Both of them needs separate channel to do their own work.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 7 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is

not applicable.

Have you seen the link I give you? Even if you are right, there still could be such a request from the firmware, no?

I may have missed the link.
You have 10 replies, so it is easy to miss important things in rest of the comments.

Quoted 5 lines
Quoted 2 lines

D3hot is controlled by the driver.

So, it requires the device context to be preserved, which is not documented in your patch.

PCI PM interactions is covered in v4 in the device requirements section.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one

for reset as well.

Quoted 2 lines
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough mode.

Can you explain why is it needed?

Qemu has a command "system_reset".

I mean, what does this translate to reset the device in passthrough mode? If this is FLR, it is there.

Quoted 57 lines
Quoted 1 line

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 54 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 31 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Quoted 9 lines
Quoted 4 lines
Quoted 3 lines

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

I have read those 4 patches and I have seen that transportvq do not want to transport notifications. Hence it does not qualify as transport vq.

Frankly, transport vq seems a way to formalize mediation forever in virtio.
It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from driver to the device.

Quoted 33 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

Quoted 8 lines
Quoted 7 lines

and usually prohibited or even unsupported.

Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 3 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Quoted 8 lines
Quoted 1 line

Once can change driver notification frequency to see if interrupt rate

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually shifting the concept.

Quoted 3 lines

Obviously, suspend is not the only way to debug. But that's not the context here.

I have no further comments on the claim that suspending a device a debug feature. If it, add a debug section and put it under that.
You also know that it is not, so let's not waste our time.

I just don’t suspend bit as debug interface that undergoes classic heisenbug effect.

Quoted 8 lines

Thanks

Quoted 6 lines
Quoted 5 lines

Thanks

Quoted 1 line
#52 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 95 lines · Parav Pandit
Quoted 95 lines

From: Jason Wang <[email protected]>
Sent: Tuesday, November 21, 2023 1:03 PM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

On Thu, Nov 16, 2023 at 1:39 AM Parav Pandit <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

On Thu, Nov 9, 2023 at 6:16 PM Parav Pandit <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 1 line · Michael S. Tsirkin

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu, Lingshan

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu Lingshan

Quoted 52 lines · wrote:
Quoted 52 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

When SUSPEND is set, device states and virtqueue states should be stablized, therefore the driver should not reset vqs when SUSPEND is set in device status.

---
   content.tex | 3 +++
   1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
content.tex index renamed from content.tex +0 -0

bcc9d4b..060b5c2
100644

content.tex +0 -0
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue

Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The device MUST reset any state of a virtqueue to
the default

state,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

content.tex

Quoted 4 lines

including the available state and the used state.

content.tex +3 -0
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is set
+in \field{device status}, the driver SHOULD NOT reset
+any

virtqueues.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue Reset}{Basic
Facilities of a

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a queue,
the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides migration.

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make

sense.

Quoted 3 lines
Quoted 3 lines

Why, device status (e.g reset) belongs to that part.

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line

Instead of claiming it as some non_device_migration facility does not make

sense.

It is used for migration for sure.

This is why it is not working when device is directly mapped.

We circle back. It works for the case of trap/emulation.

For direct mapping:

You claim guest reset can work but suspend can't?

Quoted 1 line

The hypervisor messing this bit and guest is also doing power management with it.

So I don't see how it differs from: virtio reset and FLR is under the control of guests.

Quoted 15 lines

Both of them needs separate channel to do their own work.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 8 lines
Quoted 7 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

D3cold is not controlled by the driver as defined by the PCI spec hence it is

not applicable.

Have you seen the link I give you? Even if you are right, there still could be such a request from the firmware, no?

I may have missed the link.
You have 10 replies, so it is easy to miss important things in rest of the comments.

I meant there still could be D3cold requests from the guest via virtual firmware.

So it's not necessarily related to the guest driver.

Quoted 16 lines
Quoted 6 lines
Quoted 3 lines

D3hot is controlled by the driver.

So, it requires the device context to be preserved, which is not documented in your patch.

PCI PM interactions is covered in v4 in the device requirements section.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one

Quoted 8 lines
Quoted 7 lines

for reset as well.

Quoted 2 lines
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough mode.

Can you explain why is it needed?

Qemu has a command "system_reset".

I mean, what does this translate to reset the device in passthrough mode?

It needs to reset the virtio device.

Quoted 1 line

If this is FLR, it is there.

Please explain how it works. (It's not only a FLR, it also need virtio level reset)

Quoted 61 lines
Quoted 61 lines
Quoted 2 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 57 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 34 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

I have read those 4 patches and I have seen that transportvq do not want to transport notifications. Hence it does not qualify as transport vq.

It exposes the platform MMIO area for driver notification. This is sufficient. Any issue you see?

Quoted 2 lines

Frankly, transport vq seems a way to formalize mediation forever in virtio.

Nope, it can be accessed by a guest driver directly.

Quoted 2 lines

It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from driver to the device.

See above. SIOV might require a new transport or not.

Quoted 36 lines
Quoted 36 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

Quoted 8 lines
Quoted 7 lines

and usually prohibited or even unsupported.

Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 4 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate

Quoted 8 lines
Quoted 7 lines

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually shifting the concept.

It's not.

Ling Shan put it in the basic facilities as part of device status. You wonder why, we explained it can be used beyond migration. You asked where, we told you for example things like debugging. We never claim it can only be used in debug. Then you shift the concept to say debug could be achieved by a lot of other facilities. For sure this is correct, but it doesn't have any relationship with the discussion here.

Quoted 9 lines
Quoted 4 lines

Obviously, suspend is not the only way to debug. But that's not the context here.

I have no further comments on the claim that suspending a device a debug feature. If it, add a debug section and put it under that.
You also know that it is not, so let's not waste our time.

I just don’t suspend bit as debug interface that undergoes classic heisenbug effect.

I never say it can be used for solving all problems. Anyhow that's another topic right?

Thanks

Quoted 10 lines
Quoted 9 lines

Thanks

Quoted 6 lines
Quoted 5 lines

Thanks

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#53 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 115 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:58 AM

Quoted 6 lines · Parav Pandit
Quoted 6 lines

From: Jason Wang <[email protected]>
Sent: Tuesday, November 21, 2023 1:03 PM

On Thu, Nov 16, 2023 at 1:27 PM Parav Pandit <[email protected]>

Quoted 58 lines · wrote:
Quoted 58 lines
Quoted 5 lines
Quoted 5 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

On Thu, Nov 16, 2023 at 1:39 AM Parav Pandit <[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

On Thu, Nov 9, 2023 at 6:16 PM Parav Pandit
<[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 2 lines · Michael S. Tsirkin

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu,
Lingshan

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines · Michael S. Tsirkin
Quoted 2 lines

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu
Lingshan

Quoted 29 lines · wrote:
Quoted 29 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

When SUSPEND is set, device states and virtqueue
states should be stablized, therefore the driver
should not reset vqs when SUSPEND is set in device status.

Signed-off-by: Zhu Lingshan
<[email protected]>
---
content.tex | 3 +++
1 file changed, 3 insertions(+)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

diff --git a/content.tex b/content.tex index
bcc9d4b..060b5c2
100644
--- a/content.tex
+++ b/content.tex
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue
Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The device MUST reset any state of a virtqueue
to the default

state,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is
+set in \field{device status}, the driver SHOULD
+NOT reset any

virtqueues.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue
Reset}{Basic Facilities of a

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

After the driver tells the device to reset a
queue, the driver MUST verify that

Seems somewhat arbitrary and breaks the claim that the feature is orthogonal and can have uses besides

migration.

Quoted 38 lines
Quoted 38 lines
Quoted 18 lines
Quoted 18 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make

sense.

Quoted 5 lines
Quoted 3 lines

Why, device status (e.g reset) belongs to that part.

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 2 lines

Instead of claiming it as some non_device_migration facility does not make

sense.

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

It is used for migration for sure.

This is why it is not working when device is directly mapped.

We circle back. It works for the case of trap/emulation.

For direct mapping:

You claim guest reset can work but suspend can't?

No. guest reset to be done by the guest.
Suspend for PM also to be done by guest.

The hypervisor will have 2 modes, stop and freeze as admin operation for device migration flow without telling the guest driver about it.

Quoted 7 lines
Quoted 2 lines

The hypervisor messing this bit and guest is also doing power management

with it.

So I don't see how it differs from: virtio reset and FLR is under the control of guests.

And suspend for power management too under control of the guest.

Quoted 19 lines
Quoted 19 lines

Both of them needs separate channel to do their own work.

Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is

not applicable.

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Have you seen the link I give you? Even if you are right, there still could be such a request from the firmware, no?

I may have missed the link.
You have 10 replies, so it is easy to miss important things in rest of the

comments.

I meant there still could be D3cold requests from the guest via virtual firmware.

So it will deliver PME.

Quoted 27 lines

So it's not necessarily related to the guest driver.

Quoted 20 lines
Quoted 6 lines
Quoted 3 lines

D3hot is controlled by the driver.

So, it requires the device context to be preserved, which is not documented in your patch.

PCI PM interactions is covered in v4 in the device requirements section.

Quoted 12 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one

for reset as well.

Quoted 2 lines
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough

mode.

Quoted 4 lines
Quoted 4 lines

Can you explain why is it needed?

Qemu has a command "system_reset".

Quoted 8 lines
Quoted 1 line

I mean, what does this translate to reset the device in passthrough mode?

It needs to reset the virtio device.

Quoted 1 line

If this is FLR, it is there.

Please explain how it works. (It's not only a FLR, it also need virtio level reset)

FLR obviously covers the virtio level reset as FLR covers the PCI + virtio reset.

Quoted 69 lines
Quoted 69 lines
Quoted 69 lines
Quoted 3 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 52 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 29 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

Quoted 7 lines
Quoted 5 lines

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

Quoted 6 lines
Quoted 1 line

I have read those 4 patches and I have seen that transportvq do not want to

transport notifications.

Quoted 1 line

Hence it does not qualify as transport vq.

It exposes the platform MMIO area for driver notification. This is sufficient. Any issue you see?

Yes, the issue is, it is not transporting the driver notifications. Hence, it is not a transport virtqueue.

Quoted 4 lines
Quoted 3 lines

Frankly, transport vq seems a way to formalize mediation forever in virtio.

Quoted 8 lines

Nope, it can be accessed by a guest driver directly.

Quoted 2 lines

It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from

driver to the device.

See above. SIOV might require a new transport or not.

It depends on the performance tests that Lingshan will show at scale.

Quoted 48 lines
Quoted 38 lines
Quoted 38 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

and usually prohibited or even unsupported.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 5 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate

Quoted 8 lines
Quoted 7 lines

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually

shifting the concept.

Quoted 9 lines

It's not.

Ling Shan put it in the basic facilities as part of device status. You wonder why, we explained it can be used beyond migration. You asked where, we told you for example things like debugging. We never claim it can only be used in debug. Then you shift the concept to say debug could be achieved by a lot of other facilities. For sure this is correct, but it doesn't have any relationship with the discussion here.

I don’t see wasting time here.
If its debug, its debug.
If its migration, it is migration.
If its pm, its pm.

Quoted 27 lines
Quoted 5 lines
Quoted 4 lines

Obviously, suspend is not the only way to debug. But that's not the context here.

I have no further comments on the claim that suspending a device a debug

feature.

Quoted 4 lines

If it, add a debug section and put it under that. You also know that it is not, so let's not waste our time.

I just don’t suspend bit as debug interface that undergoes classic heisenbug

effect.

I never say it can be used for solving all problems. Anyhow that's another topic right?

Thanks

Quoted 10 lines
Quoted 9 lines

Thanks

Quoted 6 lines
Quoted 5 lines

Thanks

Quoted 1 line
#54 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 117 lines · Parav Pandit
Quoted 117 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:58 AM

Quoted 6 lines · Parav Pandit
Quoted 6 lines

From: Jason Wang <[email protected]>
Sent: Tuesday, November 21, 2023 1:03 PM

On Thu, Nov 16, 2023 at 1:27 PM Parav Pandit <[email protected]>

Quoted 58 lines · wrote:
Quoted 58 lines
Quoted 5 lines
Quoted 5 lines

From: Jason Wang <[email protected]>
Sent: Thursday, November 16, 2023 9:50 AM

On Thu, Nov 16, 2023 at 1:39 AM Parav Pandit <[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Jason Wang <[email protected]>
Sent: Monday, November 13, 2023 9:05 AM

On Thu, Nov 9, 2023 at 6:16 PM Parav Pandit
<[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Zhu, Lingshan <[email protected]>
Sent: Thursday, November 9, 2023 3:28 PM

Quoted 2 lines · Michael S. Tsirkin

On Tue, Nov 07, 2023 at 05:27:23PM +0800, Zhu,
Lingshan

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines · Michael S. Tsirkin
Quoted 2 lines

On Fri, Nov 03, 2023 at 06:34:34PM +0800, Zhu
Lingshan

Quoted 29 lines · wrote:
Quoted 29 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

When SUSPEND is set, device states and virtqueue
states should be stablized, therefore the driver
should not reset vqs when SUSPEND is set in device status.

Signed-off-by: Zhu Lingshan
<[email protected]>
---
content.tex | 3 +++
1 file changed, 3 insertions(+)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

diff --git a/content.tex b/content.tex index
bcc9d4b..060b5c2
100644
--- a/content.tex
+++ b/content.tex
@@ -444,6 +444,9 @@ \subsubsection{Virtqueue
Reset}\label{sec:Basic

Facilities of a Virtio Device /

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The device MUST reset any state of a virtqueue
to the default

state,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

including the available state and the used state.
+If VIRTIO_F_SUSPEND is negotiated and SUSPEND is
+set in \field{device status}, the driver SHOULD
+NOT reset any

virtqueues.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

+
\drivernormative{\paragraph}{Virtqueue
Reset}{Basic Facilities of a

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Virtio Device / Virtqueues / Virtqueue Reset / Virtqueue Reset}

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

After the driver tells the device to reset a
queue, the driver MUST verify that
Seems somewhat arbitrary and breaks the claim that
the feature is orthogonal and can have uses besides

migration.

Quoted 39 lines
Quoted 39 lines
Quoted 18 lines
Quoted 18 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

when suspended, the device is frozen.
The driver is aware of this process and so should not reset the vqs I

think.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Again that is only true because you want to use it for migration. But then you can't claim it's a generic facility.

I don't get it. The device status is a basic facility.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

We need to SUSPEND the device by setting SUSPEND bit, to stabilize the device states for migration.

Is the PCI's PM time not enough to suspend the device?

Are you saying we don't need virtio reset assuming we had FLR?

No. often FLR timing is not enough. Hence every PCI level device has some

sort of its own reset mechanism.

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Suspending at different layers like rest at different layers.

We have both FLR and virtio reset. The Virtio level function could be reset without FLR. So did suspend.

That's it.

Sure, but wrapping it under some "basic facility" is just does not make

sense.

Quoted 5 lines
Quoted 3 lines

Why, device status (e.g reset) belongs to that part.

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 2 lines

Instead of claiming it as some non_device_migration facility does not make

sense.

It is used for migration for sure.

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

This is why it is not working when device is directly mapped.

We circle back. It works for the case of trap/emulation.

For direct mapping:

You claim guest reset can work but suspend can't?

No. guest reset to be done by the guest.

What reset did you mean here?

Quoted 1 line

Suspend for PM also to be done by guest.

PM is transport specific.

We have both FLR and reset. So we have a transport PM and suspend.

Quoted 2 lines

The hypervisor will have 2 modes, stop and freeze as admin operation for device migration flow without telling the guest driver about it.

What prevents stop/freeze work here?

Quoted 31 lines
Quoted 8 lines
Quoted 3 lines

The hypervisor messing this bit and guest is also doing power management

with it.

So I don't see how it differs from: virtio reset and FLR is under the control of guests.

And suspend for power management too under control of the guest.

Quoted 21 lines
Quoted 21 lines

Both of them needs separate channel to do their own work.

Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And if you want to rule P2P behaviours, PCI PM is really the correct way to go instead of trying to do it at the virtio layer.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

PCI PM is supposed to be controlled by the guest and so the suspend.

I've listed issues about D3cold and others, I can't believe it can't be controlled totally by guests.

D3cold is not controlled by the driver as defined by the PCI spec hence it is

not applicable.

Have you seen the link I give you? Even if you are right, there still could be such a request from the firmware, no?

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

I may have missed the link.
You have 10 replies, so it is easy to miss important things in rest of the

comments.

I meant there still could be D3cold requests from the guest via virtual firmware.

So it will deliver PME.

So what do you want to say here?

Quoted 30 lines
Quoted 30 lines

So it's not necessarily related to the guest driver.

Quoted 20 lines
Quoted 6 lines
Quoted 3 lines

D3hot is controlled by the driver.

So, it requires the device context to be preserved, which is not documented in your patch.

PCI PM interactions is covered in v4 in the device requirements section.

Quoted 12 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

Hypervisor needs its channel to suspend the device, as fundamentally guest is

unaware of device migration flow.

That's pretty fine, the hypervisor also needs its channel to reset the device. If you think there's a conflict with suspend, there should be one

for reset as well.

Quoted 2 lines
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough

mode.

Quoted 5 lines
Quoted 4 lines

Can you explain why is it needed?

Qemu has a command "system_reset".

I mean, what does this translate to reset the device in passthrough mode?

Quoted 7 lines
Quoted 6 lines

It needs to reset the virtio device.

Quoted 1 line

If this is FLR, it is there.

Please explain how it works. (It's not only a FLR, it also need virtio level reset)

FLR obviously covers the virtio level reset as FLR covers the PCI + virtio reset.

Which part of the spec says this? And at least Qemu is not implemented in this way.

And there's another conflict, you said FLR is under the control of guests ...

Quoted 70 lines
Quoted 70 lines
Quoted 70 lines
Quoted 70 lines
Quoted 4 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 52 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 29 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

Quoted 7 lines
Quoted 5 lines

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I have read those 4 patches and I have seen that transportvq do not want to

transport notifications.

Quoted 1 line

Hence it does not qualify as transport vq.

It exposes the platform MMIO area for driver notification. This is sufficient. Any issue you see?

Yes, the issue is, it is not transporting the driver notifications. Hence, it is not a transport virtqueue.

Please read how driver/device notification is done in the spec for existing transports.

Quoted 72 lines
Quoted 5 lines
Quoted 4 lines

Frankly, transport vq seems a way to formalize mediation forever in virtio.

Quoted 8 lines

Nope, it can be accessed by a guest driver directly.

Quoted 2 lines

It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from

driver to the device.

See above. SIOV might require a new transport or not.

It depends on the performance tests that Lingshan will show at scale.

Quoted 48 lines
Quoted 38 lines
Quoted 38 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

and usually prohibited or even unsupported.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 5 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate

Quoted 8 lines
Quoted 7 lines

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually

shifting the concept.

Quoted 9 lines

It's not.

Ling Shan put it in the basic facilities as part of device status. You wonder why, we explained it can be used beyond migration. You asked where, we told you for example things like debugging. We never claim it can only be used in debug. Then you shift the concept to say debug could be achieved by a lot of other facilities. For sure this is correct, but it doesn't have any relationship with the discussion here.

Quoted 4 lines

I don’t see wasting time here.
If its debug, its debug.
If its migration, it is migration.
If its pm, its pm.

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

Thanks

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#55 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 10 lines · Jason Wang
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough

mode.

Quoted 5 lines
Quoted 4 lines

Can you explain why is it needed?

Qemu has a command "system_reset".

I mean, what does this translate to reset the device in passthrough mode?

It needs to reset the virtio device.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

If this is FLR, it is there.

Please explain how it works. (It's not only a FLR, it also need virtio level reset)

FLR obviously covers the virtio level reset as FLR covers the PCI + virtio reset.

Which part of the spec says this? And at least Qemu is not implemented in this way.

PCI spec says this. And yes I believe qemu will fully reset the function on FLR.

Quoted 76 lines

And there's another conflict, you said FLR is under the control of guests ...

Quoted 74 lines
Quoted 74 lines
Quoted 63 lines
Quoted 63 lines
Quoted 4 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 57 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 34 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

I have read those 4 patches and I have seen that transportvq do not want to

transport notifications.

Quoted 1 line

Hence it does not qualify as transport vq.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

It exposes the platform MMIO area for driver notification. This is sufficient. Any issue you see?

Yes, the issue is, it is not transporting the driver notifications. Hence, it is not a transport virtqueue.

Please read how driver/device notification is done in the spec for existing transports.

Yea Parav I don't really see what you are driving at here. But the bigger problem with tvq is that it was supposed to add a new group type and be reworked on top of admin command infrastructure and it never was.

Quoted 63 lines
Quoted 63 lines
Quoted 5 lines
Quoted 4 lines

Frankly, transport vq seems a way to formalize mediation forever in virtio.

Quoted 8 lines

Nope, it can be accessed by a guest driver directly.

Quoted 2 lines

It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from

driver to the device.

See above. SIOV might require a new transport or not.

It depends on the performance tests that Lingshan will show at scale.

Quoted 48 lines
Quoted 38 lines
Quoted 38 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

and usually prohibited or even unsupported.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 5 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate

Quoted 8 lines
Quoted 7 lines

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually

shifting the concept.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

It's not.

Ling Shan put it in the basic facilities as part of device status. You wonder why, we explained it can be used beyond migration. You asked where, we told you for example things like debugging. We never claim it can only be used in debug. Then you shift the concept to say debug could be achieved by a lot of other facilities. For sure this is correct, but it doesn't have any relationship with the discussion here.

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.
For debug you want something that just always works.
Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here.
If its debug, its debug.
If its migration, it is migration.
If its pm, its pm.

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities. The logical continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these. Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#56 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 16 lines · Michael S. Tsirkin
Quoted 14 lines · Jason Wang
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

I don’t see a need for hypervisor to reset the device in passthrough

mode.

Quoted 5 lines
Quoted 4 lines

Can you explain why is it needed?

Qemu has a command "system_reset".

I mean, what does this translate to reset the device in passthrough mode?

It needs to reset the virtio device.

Quoted 1 line

If this is FLR, it is there.

Please explain how it works. (It's not only a FLR, it also need virtio level reset)

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

FLR obviously covers the virtio level reset as FLR covers the PCI + virtio reset.

Which part of the spec says this? And at least Qemu is not implemented in this way.

PCI spec says this.
And yes I believe qemu will fully reset the function on FLR.

Ok, I have another glance at the spec and code. It works like this.

Quoted 163 lines
Quoted 78 lines

And there's another conflict, you said FLR is under the control of guests ...

Quoted 74 lines
Quoted 74 lines
Quoted 63 lines
Quoted 63 lines
Quoted 4 lines

Do you mean, it is needed in vdpa mode? If yes, the registers are emulated

anyway, so why the member device's native channel cannot be used in vdpa mode?

Quoted 57 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

For large device I could imagine it could be short.

In that case if there is suspend the device available, it will be used by the guest

driver itself, hypervisor wouldn’t know about it when those registers are not trapped.

Quoted 3 lines

So we need two ways to suspend.
One is guest visible, and guest controlled.
Second is hypervisor control to fulfill the device migration needs.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

Can you explain why suspend is special but not reset or why reset can work but not suspend? If reset can work, so does suspend. If reset can't, neither does suspend.

As long as reset and suspend both are under guest control, I am fine.

Well, you seem to ignore my question below. Hypervisor needs to reset the device as well.

Why is it needed in passthrough mode?

Quoted 34 lines
Quoted 16 lines
Quoted 11 lines

For example, can you explain how a system_reset in Qemu can work with your proposal?

Quoted 3 lines

So if you can please take a look if the proposed admin command to

freeze/stop mode can be used in the emulated register case or not.

Again, if you design those for PCI, it's a layer violation. You have answered

They are used by the PCI layer, just like your suspend bit. Andy other transport can also use it.

Quoted 2 lines

yourself that PM is the right way to go.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

It helps to have the suspend bit in guest control as well with/without

emulation mode.

I won't repeat it again. You will find you need a full transport to satisfy all the requirements.

I disagree for full transport.

See above and the discussion in another thread.

Quoted 3 lines

If you want to get discuss transport for sure it is some other thread and I want to see "driver notifications via such transport VQ" to fully qualify it

as transport, And that would be just sub-optimal for actual working.

Sub-optimal since the function is duplicated with a transport but it doesn't claim or design as a transport.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

It is not sub-optimal because of duplication. It is because you want to

transport notifications via virtqueue.

Have you ever read the series of tvq? You won't get this conclusion if you do that.

I have read those 4 patches and I have seen that transportvq do not want to

transport notifications.

Quoted 1 line

Hence it does not qualify as transport vq.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

It exposes the platform MMIO area for driver notification. This is sufficient. Any issue you see?

Yes, the issue is, it is not transporting the driver notifications. Hence, it is not a transport virtqueue.

Please read how driver/device notification is done in the spec for existing transports.

Yea Parav I don't really see what you are driving at here. But the bigger problem with tvq is that it was supposed to add a new group type and be reworked on top of admin command infrastructure and it never was.

Quoted 63 lines
Quoted 63 lines
Quoted 5 lines
Quoted 4 lines

Frankly, transport vq seems a way to formalize mediation forever in virtio.

Quoted 8 lines

Nope, it can be accessed by a guest driver directly.

Quoted 2 lines

It is very weird way to build new SIOV device.
For most things it should be the direct channel that virtio has already from

driver to the device.

See above. SIOV might require a new transport or not.

It depends on the performance tests that Lingshan will show at scale.

Quoted 48 lines
Quoted 38 lines
Quoted 38 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines

And hence, I wouldn’t call it a transport anymore.

Quoted 13 lines
Quoted 6 lines
Quoted 3 lines

This can also be used for debugging I think.

As Michael listed, a dedicated debug interface is usually more useful instead

of in-band.

Well, I've shown you the in-band facilities like debugging via ethtool and kernel has a lot of other ones. If you have ever tried to debug in a real production environment, you will find how useful such handy information is where out-of- band facilities are often dangerous

and usually prohibited or even unsupported.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Guest driver can always read and write the device status without adding a

suspend bit.

I don't get here. Suspend make sure the device state is frozen which helps for debugging for sure.

You wanted to debug some vq live, you suspend the device, the vq state got

changed.

Quoted 2 lines

I just don’t see that suspend is a debug tool.

It's not a tool, it's a function that can be used as a debug tool.

Quoted 5 lines

Every feature is a debug feature literally.
Classic heisenbug effect.

Once can change driver notification frequency to see if interrupt rate

Quoted 8 lines
Quoted 7 lines

changed for debugging.

Quoted 3 lines

One can disabled few RQs and see RSS...
Blk can change blk_size to higher value to perf debug.. The list continues..

Let's not shift concepts.

Your comment to attribute device migration as debug feature is actually

shifting the concept.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

It's not.

Ling Shan put it in the basic facilities as part of device status. You wonder why, we explained it can be used beyond migration. You asked where, we told you for example things like debugging. We never claim it can only be used in debug. Then you shift the concept to say debug could be achieved by a lot of other facilities. For sure this is correct, but it doesn't have any relationship with the discussion here.

Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Quoted 11 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here.
If its debug, its debug.
If its migration, it is migration.
If its pm, its pm.

Quoted 5 lines
Quoted 2 lines

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Then we can invent new things.

Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication and a layer violation.

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#57 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 6 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

Quoted 11 lines
Quoted 11 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Then we can invent new things.

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency. You don't like it fine but there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 7 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though. It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 8 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency. I actually suggested ways to reduce duplication, by using transport offsets as tags. Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

Quoted 1 line

and a layer violation.

layers are only good if they make sense.

Quoted 7 lines

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#58 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

Quoted 7 lines
Quoted 3 lines

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

In that case we still need a preise definition of the state. So I don't see the difference here.

Anyhow, we can leave debugging aside.

Quoted 19 lines
Quoted 19 lines
Quoted 18 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Quoted 6 lines
Quoted 1 line

Then we can invent new things.

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency.
You don't like it fine but

The (partial) duplication should be fine as long as it doesn't have any issue, but I do see a lot of issues. So I can't say I like it.

Quoted 7 lines

there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 5 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

Quoted 5 lines
Quoted 2 lines

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though.

That's my understanding as well. It's up to the hypervisor, spec needs to focus on the mechanism but not policy.

Quoted 8 lines

It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 4 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

Quoted 6 lines
Quoted 4 lines

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency.

Just to clarify, we do need things like suspend but I don't see dealing with PCI P2P in virtio as consistent (e.g we don't imply any PCI stuff in virtio reset).

Quoted 3 lines

I actually
suggested ways to reduce duplication, by using transport offsets as tags.

I don't see a connection with P2P here. Or I may miss something.

Quoted 3 lines

Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

There is a misunderstanding. Actually. I don't want to force registers. Which kind of interface is the best way to go is really implementation specific. In some implementations, registers are cheap but not virtqueue, in others, virtqueue is cheap but not register. They are all fine. But we can't not claim one proposal that is optimized for a specific implementation to be the best way. What I want to do is not limit the facilities that are used for live migration to any specific transport. I think Ling Shan agreed with me in this part. It needs to work on all interfaces regardless of registers, DMA, CMA or others. That's why I suggest we focus on what needs to be migrated first. That is define the following things

1) way to suspend/resume a device
2) virtqueue states, indices or inflight ones
3) device states

It is just like how we define virtqueues/features/status and other basic facilities where we do not tie it to any specific interfaces like DMA, CMA, registers or admin commands. Virtio benefited from the flexibility like this in the past so why not stick to that?

After this, each transport can choose to implement it in their own way. For example, if there's a proposal to use those via admin virtqueue that's fine. And registers also fine and other transports. That's why only the last patch of this series is dealing with the PCI specific part.

Quoted 4 lines
Quoted 2 lines

and a layer violation.

layers are only good if they make sense.

Case by case, for example, PCI PM has defined the state and the interaction with P2P. Reusing that seems much cleaner than inventing a mechanism in the virtio layer. Or if it needs a side channel, it needs to be invented in PCI not virtio.

Thanks

Quoted 9 lines
Quoted 8 lines

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#59 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 10 lines · Jason Wang
Quoted 9 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Quoted 6 lines
Quoted 3 lines

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

In that case we still need a preise definition of the state. So I don't see the difference here.

You don't? If you can inspect state without perturbing it, that is better for debugging than an intrusive interface that perturbs state.

Quoted 23 lines

Anyhow, we can leave debugging aside.

Quoted 21 lines
Quoted 20 lines
Quoted 13 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Quoted 5 lines
Quoted 2 lines

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Then we can invent new things.

Quoted 7 lines
Quoted 4 lines

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency.
You don't like it fine but

The (partial) duplication should be fine as long as it doesn't have any issue, but I do see a lot of issues. So I can't say I like it.

Let's focus on issue really instead of endless high level architecture discussions.

Quoted 26 lines
Quoted 7 lines

there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 5 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

Quoted 5 lines
Quoted 2 lines

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though.

That's my understanding as well. It's up to the hypervisor, spec needs to focus on the mechanism but not policy.

Quoted 10 lines

It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 6 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

But it's not the case for others.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency.

Just to clarify, we do need things like suspend but I don't see dealing with PCI P2P in virtio as consistent (e.g we don't imply any PCI stuff in virtio reset).

I think I can clarify. The consistency is that there's a single chapter that deals with migration, also hypervisors will all do exactly the same instead of each hypervisor guessing how to do migration and going its own way.

Quoted 5 lines
Quoted 3 lines

I actually
suggested ways to reduce duplication, by using transport offsets as tags.

I don't see a connection with P2P here. Or I may miss something.

I don't even know what P2P is in this context. Or why we are discussing it. Is this going to be another distraction that no one knows how it will work, just like mentioning TD randomly?

Quoted 6 lines
Quoted 3 lines

Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

There is a misunderstanding. Actually. I don't want to force registers.

You keep insisting on overlaying suspend functionality over the existing transport. For pci that is going to be in a register.

Quoted 11 lines

Which kind of interface is the best way to go is really implementation specific. In some implementations, registers are cheap but not virtqueue, in others, virtqueue is cheap but not register. They are all fine. But we can't not claim one proposal that is optimized for a specific implementation to be the best way. What I want to do is not limit the facilities that are used for live migration to any specific transport. I think Ling Shan agreed with me in this part. It needs to work on all interfaces regardless of registers, DMA, CMA or others. That's why I suggest we focus on what needs to be migrated first. That is define the following things

Quoted 8 lines

1) way to suspend/resume a device
2) virtqueue states, indices or inflight ones
3) device states

It is just like how we define virtqueues/features/status and other basic facilities where we do not tie it to any specific interfaces like DMA, CMA, registers or admin commands. Virtio benefited from the flexibility like this in the past so why not stick to that?

Because migration is a complex enough topic that we simply know from experience that
- things like error handling are needed
- passing big arrays around is needed
these just do not work reasonably well over registers and this is why admin commands were invented.

Quoted 6 lines

After this, each transport can choose to implement it in their own way. For example, if there's a proposal to use those via admin virtqueue that's fine.
And registers also fine and other transports.
That's why only the last patch of this series is dealing with the PCI specific part.

Maybe they are fine in theory. So far I didn't see anything cohesive that is close functionally being even to Parav's proposal of migration over admin commands. There's no specific *reason* not to do that, practically - I don't see why

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

and a layer violation.

Quoted 8 lines
Quoted 1 line

layers are only good if they make sense.

Case by case, for example, PCI PM has defined the state and the interaction with P2P. Reusing that seems much cleaner than inventing a mechanism in the virtio layer. Or if it needs a side channel, it needs to be invented in PCI not virtio.

Thanks

There's no *if* in my opinion - migration is way easier for hypervisors to implement as a side channel so any device state can be migrated. And this is uniform across transports. Is it harder or easier for hardware to implement? We have a hardware vendor pushing a side channel approach so it seems likely they know what is good for hardware? If it is somehow nvidia specific - can we please have other vendors with actual plans implementing this hardware (and note this has nothing to do with VDPA - all this SUSPEND bit work is only useful for full offload) come forward and say "we don't support this, we support that"? Or is this for some unnamed vendors not on the TC? Maybe they should join the TC to influence the direction then. Because right now it looks like software guys telling hardware guys what is good for hardware and I don't see how this makes any sense.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#60 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 12 lines · Michael S. Tsirkin
Quoted 10 lines · Jason Wang
Quoted 9 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

In that case we still need a preise definition of the state. So I don't see the difference here.

You don't?

I meant I don't see the difference if

1) it is defined in a new bit in current status
2) or it's an orthogonal state

Quoted 2 lines

If you can inspect state without perturbing it, that is better for debugging than an intrusive interface that perturbs state.

I've stated that it is just like you can choose to use GDB or not. If you don't like GDB, that's fine.

We propose it in the basic facility, you are asking why, we explain it might be used for debugging or others, then you said you don't want it for debugging. It's fine but what's the standard here? For example, even if it can only be used for migration, what's the issue here? FEAUTRE_OK can only be used during driver probes but it is still defined in the status part, and there's nobody asking for other use cases.

Quoted 30 lines
Quoted 30 lines

Anyhow, we can leave debugging aside.

Quoted 25 lines
Quoted 13 lines
Quoted 13 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Then we can invent new things.

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency.
You don't like it fine but

Quoted 5 lines
Quoted 2 lines

The (partial) duplication should be fine as long as it doesn't have any issue, but I do see a lot of issues. So I can't say I like it.

Let's focus on issue really instead of endless high level architecture discussions.

I don't understand here. I've pointed out sufficient issues in detail in individual patches. At least a small fraction of issues have been acked by Parav. If you think it's not a real issue, please explain in the individual thread.

Quoted 32 lines
Quoted 32 lines
Quoted 8 lines

there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 5 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

Quoted 5 lines
Quoted 2 lines

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though.

That's my understanding as well. It's up to the hypervisor, spec needs to focus on the mechanism but not policy.

Quoted 14 lines

It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 8 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency.

Quoted 8 lines
Quoted 3 lines

Just to clarify, we do need things like suspend but I don't see dealing with PCI P2P in virtio as consistent (e.g we don't imply any PCI stuff in virtio reset).

I think I can clarify. The consistency is that there's a single chapter that deals with migration, also hypervisors will all do exactly the same instead of each hypervisor guessing how to do migration and going its own way.

Hypervisors have already done migration in different ways. Virtio should not be involved in the endless debating on which one is better, I think we have agreed on this, otherwise we spent months circling back.

Quoted 4 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I actually
suggested ways to reduce duplication, by using transport offsets as tags.

I don't see a connection with P2P here. Or I may miss something.

I don't even know what P2P is in this context. Or why we are discussing it.

The context is the suspend function. Parav tries to rule P2P in freeze/stop, and it looks to me it has been covered by PCI PM.

Quoted 7 lines

Is this going to be another distraction that
no one knows how it will work, just like mentioning TD randomly?

Quoted 4 lines
Quoted 3 lines

Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

Quoted 5 lines
Quoted 2 lines

There is a misunderstanding. Actually. I don't want to force registers.

You keep insisting on overlaying suspend functionality over the existing transport.

It makes sure it could be reused for transport other than PCI. And it doesn't prevent the coexistence of a side channel.

Quoted 2 lines

For pci that is going to be
in a register.

I don't understand. The register is already there. If you disagree, please explain, especially why reset at virtio in status can work but not suspend.

Quoted 16 lines
Quoted 16 lines

Which kind of interface is the best way to go is really implementation specific. In some implementations, registers are cheap but not virtqueue, in others, virtqueue is cheap but not register. They are all fine. But we can't not claim one proposal that is optimized for a specific implementation to be the best way. What I want to do is not limit the facilities that are used for live migration to any specific transport. I think Ling Shan agreed with me in this part. It needs to work on all interfaces regardless of registers, DMA, CMA or others. That's why I suggest we focus on what needs to be migrated first. That is define the following things

1) way to suspend/resume a device
2) virtqueue states, indices or inflight ones
3) device states

Quoted 8 lines
Quoted 4 lines

It is just like how we define virtqueues/features/status and other basic facilities where we do not tie it to any specific interfaces like DMA, CMA, registers or admin commands. Virtio benefited from the flexibility like this in the past so why not stick to that?

Because migration is a complex enough topic that we simply know from experience that
- things like error handling are needed

Where is it in the Parav series?

Quoted 1 line

- passing big arrays around is needed

Not necessarily for

1) simple devices
2) devices that are using states in the memory
3) even between device and driver, there are vendors that offload the migration to DPU

But again, I'm not saying passing big arrays doesn't make sense, please do not misunderstand my point here.

Quoted 2 lines

these just do not work reasonably well over registers and this is why admin commands were invented.

I'm lost here. The reason why we stick admin commands is to make sure it can be used for register and I wouldn't argue this furtherly. I don't say admin commands don't make sense. I just say it should not be limited to that. We can't say admin commands can work in any case or transport.

Quoted 11 lines
Quoted 9 lines

After this, each transport can choose to implement it in their own way. For example, if there's a proposal to use those via admin virtqueue that's fine.
And registers also fine and other transports.
That's why only the last patch of this series is dealing with the PCI specific part.

Maybe they are fine in theory.

Tehroticall fine can be done by just relocating texts to a better place. It's almost free. Do you want a draft?

Quoted 4 lines

So far I didn't see anything cohesive
that is close functionally being even to Parav's proposal of migration over admin commands. There's no specific *reason* not to do that, practically - I don't see why

I never say we can not do it over admin commands. I say we should not *only* do it over admin commands.

Quoted 13 lines
Quoted 13 lines
Quoted 7 lines
Quoted 5 lines

and a layer violation.

layers are only good if they make sense.

Case by case, for example, PCI PM has defined the state and the interaction with P2P. Reusing that seems much cleaner than inventing a mechanism in the virtio layer. Or if it needs a side channel, it needs to be invented in PCI not virtio.

Quoted 4 lines
Quoted 1 line

Thanks

There's no *if* in my opinion - migration is way easier for hypervisors to implement as a side channel so any device state can be migrated.

The context is to freeze PCI P2P which is a transport specific mechanism not device states. When there's an existing mechanism, it's pretty natural to ask why it can't be used or extended.

I must repeat myself again, It's perfectly fine to use the side channel to save and restore device state but it's not the only way.

Quoted 2 lines

And
this is uniform across transports.

I don't understand, for example in 1) MMIO 2) PCI without SR-IOV, where could we put a side channel?

Quoted 2 lines

Is it harder or easier for hardware
to implement?

Well, easier for one vendor doesn't mean easier for rest vendors.

And how to synchronize between the transport and the side channel is still unclear to me at least. So far the only thing I get is something like "it is implementation specific", so I raise the issue like PM/D3/FLR/FRS during migration etc where I haven't got a good answer so far. Or if you think spec is ok without answering those questions, that's fine but please explain why.

Quoted 2 lines

We have a hardware vendor pushing a side channel approach so it seems likely they know what is good for hardware?

If the above is a standard like "a hardware vendor pushing an approach, it seems likely they know what is good for their hardware", then it should apply to every vendor instead of just a specific one.

So this calls for a generic design. For example I know virtio that has been implemented in software, DPU or FPGA (for sure there should be others). I fully understand that a proposal from a specific vendor can work well for them. But it doesn't mean it works well for others. Do you agree? AFAIK, some early versions of IFCVF did virtio via FPGA, and I guess NV did virtio via collaboration with software running on DPU. Different hardware architecture may end up with different design considerations. And there's nothing wrong with them. But what works better for FPGA doesn't mean it works better in DPU. One key for the future success of virtio is to not be designed just for a specific type of hardware or vendor. That's why I disagree with your statement like "who bothers first who wins".

Quoted 6 lines

If it is somehow
nvidia specific - can we please have other vendors with actual plans implementing this hardware
(and note this has nothing to do with
VDPA - all this SUSPEND bit work is only useful for full offload) come forward and say "we don't support this, we support that"?

On one hand, you said "the first will win", then Ling Shan told you IFCVF has been used in production for years.
On the other hand, you want to have a 3rd vendor to comment, so the standard seems to shift to "the majority will win" and you don't even ask for a prototype there?

There's no description on what kind of prototyping is done in the Parav series, for example, what kind of implementation for the prototype (FPGA, ASIC, DPU, emulation or simulation). Reviewers can do nothing but guess. You seem to think it's ok. Fine. But Ling Shan has told us IFCVF has been used in production for years. Sticking to the flexibility that virito spec already had is much better than waiting for a vendor to come to say "spec doesn't fit for us, we wouldn't go for virtio". Again, such decoupling is not guaranteed to succeed but it's better than coupling.

What's more, I don't see why you think the proposals must be mutually exclusive. I think both LingShan and Parav are ok for seeking ways for unficiation or then a way for co-existence.

Quoted 2 lines

Or is this
for some unnamed vendors not on the TC?

I don't get the point of the question.

TC is good but there are just too many reasons that they don't want to join TC. And even if they do, there are just too many reasons that vendors decide to be silent or not. But I don't think silence means acquiescence.

Quoted 2 lines

Maybe they should join the TC to
influence the direction then.

Chicken-egg problem. Vendors may want evaluate both the architecture and the community before they can invest in virtio.

Quoted 4 lines

Because right now it looks like software
guys telling hardware guys what is good for hardware and I don't see how
this makes any sense.

Can you explain why you think my comment doesn't make any sense and what's the reason for such classification? Most of my comments were given from the view of a hypervisor developer. It's definitely not telling what is good for hardware, it's for what is good for software. Virtio neither works at the level of circuit nor defines any implementation, so it needs to hear from both software and hardware engineers.

Thanks

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#61 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 20 lines · Jason Wang
Quoted 19 lines · Michael S. Tsirkin
Quoted 16 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

Quoted 7 lines
Quoted 3 lines

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

In that case we still need a preise definition of the state. So I don't see the difference here.

Quoted 6 lines
Quoted 1 line

You don't?

I meant I don't see the difference if

1) it is defined in a new bit in current status
2) or it's an orthogonal state

Well the difference is that we don't need to keep track of current state correctly. For example for debugging, if you can just push out commands without worrying about what other status bits are, that is best. Otherwise you need to hope that other status bits are right.

Quoted 5 lines
Quoted 2 lines

If you can inspect state without perturbing it, that is better for debugging than an intrusive interface that perturbs state.

I've stated that it is just like you can choose to use GDB or not. If you don't like GDB, that's fine.

people can use better ways to debug, I think.

Quoted 3 lines

We propose it in the basic facility, you are asking why, we explain it might be used for debugging or others, then you said you don't want it for debugging.

No, I said it's *not very useful* for debugging the way this patch builds it.

Quoted 2 lines

It's fine but what's the standard here? For example, even if it can only be used for migration, what's the issue here?

i see 2 good ways to design things
1- powerful facility to solve all of migration in 1 place 2- modular components that can be useful for other things

both seem reasonable but if you claim you are doing 2 then better show some other use to demonstrate design is good.

Quoted 3 lines

FEAUTRE_OK can only be used during driver probes but it is still defined in the status part, and there's nobody asking for other use cases.

our current status bits are designed for device to keep track of driver state. This, is not it.

Quoted 316 lines
Quoted 30 lines
Quoted 30 lines

Anyhow, we can leave debugging aside.

Quoted 25 lines
Quoted 13 lines
Quoted 13 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Then we can invent new things.

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency.
You don't like it fine but

Quoted 5 lines
Quoted 2 lines

The (partial) duplication should be fine as long as it doesn't have any issue, but I do see a lot of issues. So I can't say I like it.

Let's focus on issue really instead of endless high level architecture discussions.

I don't understand here. I've pointed out sufficient issues in detail in individual patches. At least a small fraction of issues have been acked by Parav. If you think it's not a real issue, please explain in the individual thread.

Quoted 32 lines
Quoted 32 lines
Quoted 8 lines

there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 5 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

Quoted 5 lines
Quoted 2 lines

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though.

That's my understanding as well. It's up to the hypervisor, spec needs to focus on the mechanism but not policy.

Quoted 14 lines

It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 8 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency.

Quoted 8 lines
Quoted 3 lines

Just to clarify, we do need things like suspend but I don't see dealing with PCI P2P in virtio as consistent (e.g we don't imply any PCI stuff in virtio reset).

I think I can clarify. The consistency is that there's a single chapter that deals with migration, also hypervisors will all do exactly the same instead of each hypervisor guessing how to do migration and going its own way.

Hypervisors have already done migration in different ways. Virtio should not be involved in the endless debating on which one is better, I think we have agreed on this, otherwise we spent months circling back.

Quoted 4 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I actually
suggested ways to reduce duplication, by using transport offsets as tags.

I don't see a connection with P2P here. Or I may miss something.

I don't even know what P2P is in this context. Or why we are discussing it.

The context is the suspend function. Parav tries to rule P2P in freeze/stop, and it looks to me it has been covered by PCI PM.

Quoted 7 lines

Is this going to be another distraction that
no one knows how it will work, just like mentioning TD randomly?

Quoted 4 lines
Quoted 3 lines

Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

Quoted 5 lines
Quoted 2 lines

There is a misunderstanding. Actually. I don't want to force registers.

You keep insisting on overlaying suspend functionality over the existing transport.

It makes sure it could be reused for transport other than PCI. And it doesn't prevent the coexistence of a side channel.

Quoted 2 lines

For pci that is going to be
in a register.

I don't understand. The register is already there. If you disagree, please explain, especially why reset at virtio in status can work but not suspend.

Quoted 16 lines
Quoted 16 lines

Which kind of interface is the best way to go is really implementation specific. In some implementations, registers are cheap but not virtqueue, in others, virtqueue is cheap but not register. They are all fine. But we can't not claim one proposal that is optimized for a specific implementation to be the best way. What I want to do is not limit the facilities that are used for live migration to any specific transport. I think Ling Shan agreed with me in this part. It needs to work on all interfaces regardless of registers, DMA, CMA or others. That's why I suggest we focus on what needs to be migrated first. That is define the following things

1) way to suspend/resume a device
2) virtqueue states, indices or inflight ones
3) device states

Quoted 8 lines
Quoted 4 lines

It is just like how we define virtqueues/features/status and other basic facilities where we do not tie it to any specific interfaces like DMA, CMA, registers or admin commands. Virtio benefited from the flexibility like this in the past so why not stick to that?

Because migration is a complex enough topic that we simply know from experience that
- things like error handling are needed

Where is it in the Parav series?

Quoted 1 line

- passing big arrays around is needed

Not necessarily for

1) simple devices
2) devices that are using states in the memory
3) even between device and driver, there are vendors that offload the migration to DPU

But again, I'm not saying passing big arrays doesn't make sense, please do not misunderstand my point here.

Quoted 2 lines

these just do not work reasonably well over registers and this is why admin commands were invented.

I'm lost here. The reason why we stick admin commands is to make sure it can be used for register and I wouldn't argue this furtherly. I don't say admin commands don't make sense. I just say it should not be limited to that. We can't say admin commands can work in any case or transport.

Quoted 11 lines
Quoted 9 lines

After this, each transport can choose to implement it in their own way. For example, if there's a proposal to use those via admin virtqueue that's fine.
And registers also fine and other transports.
That's why only the last patch of this series is dealing with the PCI specific part.

Maybe they are fine in theory.

Tehroticall fine can be done by just relocating texts to a better place. It's almost free. Do you want a draft?

Quoted 4 lines

So far I didn't see anything cohesive
that is close functionally being even to Parav's proposal of migration over admin commands. There's no specific *reason* not to do that, practically - I don't see why

I never say we can not do it over admin commands. I say we should not *only* do it over admin commands.

Quoted 13 lines
Quoted 13 lines
Quoted 7 lines
Quoted 5 lines

and a layer violation.

layers are only good if they make sense.

Case by case, for example, PCI PM has defined the state and the interaction with P2P. Reusing that seems much cleaner than inventing a mechanism in the virtio layer. Or if it needs a side channel, it needs to be invented in PCI not virtio.

Quoted 4 lines
Quoted 1 line

Thanks

There's no *if* in my opinion - migration is way easier for hypervisors to implement as a side channel so any device state can be migrated.

The context is to freeze PCI P2P which is a transport specific mechanism not device states. When there's an existing mechanism, it's pretty natural to ask why it can't be used or extended.

I must repeat myself again, It's perfectly fine to use the side channel to save and restore device state but it's not the only way.

Quoted 2 lines

And
this is uniform across transports.

I don't understand, for example in 1) MMIO 2) PCI without SR-IOV, where could we put a side channel?

Quoted 2 lines

Is it harder or easier for hardware
to implement?

Well, easier for one vendor doesn't mean easier for rest vendors.

And how to synchronize between the transport and the side channel is still unclear to me at least. So far the only thing I get is something like "it is implementation specific", so I raise the issue like PM/D3/FLR/FRS during migration etc where I haven't got a good answer so far. Or if you think spec is ok without answering those questions, that's fine but please explain why.

Quoted 2 lines

We have a hardware vendor pushing a side channel approach so it seems likely they know what is good for hardware?

If the above is a standard like "a hardware vendor pushing an approach, it seems likely they know what is good for their hardware", then it should apply to every vendor instead of just a specific one.

So this calls for a generic design. For example I know virtio that has been implemented in software, DPU or FPGA (for sure there should be others). I fully understand that a proposal from a specific vendor can work well for them. But it doesn't mean it works well for others. Do you agree? AFAIK, some early versions of IFCVF did virtio via FPGA, and I guess NV did virtio via collaboration with software running on DPU. Different hardware architecture may end up with different design considerations. And there's nothing wrong with them. But what works better for FPGA doesn't mean it works better in DPU. One key for the future success of virtio is to not be designed just for a specific type of hardware or vendor. That's why I disagree with your statement like "who bothers first who wins".

Quoted 6 lines

If it is somehow
nvidia specific - can we please have other vendors with actual plans implementing this hardware
(and note this has nothing to do with
VDPA - all this SUSPEND bit work is only useful for full offload) come forward and say "we don't support this, we support that"?

On one hand, you said "the first will win", then Ling Shan told you IFCVF has been used in production for years.
On the other hand, you want to have a 3rd vendor to comment, so the standard seems to shift to "the majority will win" and you don't even ask for a prototype there?

There's no description on what kind of prototyping is done in the Parav series, for example, what kind of implementation for the prototype (FPGA, ASIC, DPU, emulation or simulation). Reviewers can do nothing but guess. You seem to think it's ok. Fine. But Ling Shan has told us IFCVF has been used in production for years. Sticking to the flexibility that virito spec already had is much better than waiting for a vendor to come to say "spec doesn't fit for us, we wouldn't go for virtio". Again, such decoupling is not guaranteed to succeed but it's better than coupling.

What's more, I don't see why you think the proposals must be mutually exclusive. I think both LingShan and Parav are ok for seeking ways for unficiation or then a way for co-existence.

Quoted 2 lines

Or is this
for some unnamed vendors not on the TC?

I don't get the point of the question.

TC is good but there are just too many reasons that they don't want to join TC. And even if they do, there are just too many reasons that vendors decide to be silent or not. But I don't think silence means acquiescence.

Quoted 2 lines

Maybe they should join the TC to
influence the direction then.

Chicken-egg problem. Vendors may want evaluate both the architecture and the community before they can invest in virtio.

Quoted 4 lines

Because right now it looks like software
guys telling hardware guys what is good for hardware and I don't see how
this makes any sense.

Can you explain why you think my comment doesn't make any sense and what's the reason for such classification? Most of my comments were given from the view of a hypervisor developer. It's definitely not telling what is good for hardware, it's for what is good for software. Virtio neither works at the level of circuit nor defines any implementation, so it needs to hear from both software and hardware engineers.

Quoted 15 lines

Thanks

Quoted 13 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#62 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Michael S. Tsirkin
Quoted 144 lines · Michael S. Tsirkin
Quoted 4 lines · Jason Wang
Quoted 3 lines · Michael S. Tsirkin
Quoted 2 lines · Jason Wang
Quoted 2 lines

I frankly don't see how a bit which is completely non-orthogonal with device and driver state can be useful for debug.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

The bit is to make sure the state of a device doesn't change. It may help or not just like if you want to pause a cpu/process during the debug.

Heh. But it would be much better to have an orthogonal state that driver can just set without worrying much about device being broken somehow.

In that case we still need a preise definition of the state. So I don't see the difference here.

You don't? If you can inspect state without perturbing it, that is better for debugging than an intrusive interface that perturbs state.

Quoted 16 lines

Anyhow, we can leave debugging aside.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

For debug you want something that just always works. Not an interface that has so many requirements it will break if you look at it sidewise.

Quoted 6 lines
Quoted 4 lines

I don’t see wasting time here. If its debug, its debug.
If its migration, it is migration. If its pm, its pm.

Obviously not. Migration should leverage existing facilities as much as possible instead of duplicating them.

I don't think there's anything obvious here. A lot of device state can't be easily accessed with existing facilities.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Then we can invent new things.

So the approach this patchset takes is a single interface for all state introspection. Some duplication of functionality for the sake of consistency.
You don't like it fine but

The (partial) duplication should be fine as long as it doesn't have any issue, but I do see a lot of issues. So I can't say I like it.

Let's focus on issue really instead of endless high level architecture discussions.

Quoted 20 lines
Quoted 10 lines

there is nothing obvious that it's a bad thing. It's a tradeoff.

Quoted 6 lines
Quoted 4 lines

The logical
continuation of your reasoning would be to add state introspection commands e.g. to cvq in virtio net and then use tricks like shadow vq to issue these.

For the device state, yes. Because it is device logic and it is not what platform or transport can know.

Exactly as I thought. Don't think shadow VQ is something we can reasonably make a single migration mechanism though.

That's my understanding as well. It's up to the hypervisor, spec needs to focus on the mechanism but not policy.

Quoted 7 lines

It feels fragile and heavyweight. It's more of a work around hardware limitations.

Quoted 3 lines
Quoted 3 lines

Yea, possible, but can we not go there please? Nothing is wrong with just building commands that do exactly what we want them to do instead of trying to build a ship in a bottle.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

But it's not the case for others.

E.g in Parav's proposal, it tries to rule P2P behaviour via virtio admin commands when there is a duplication

Yes there's some duplication. Advantage is consistency.

Just to clarify, we do need things like suspend but I don't see dealing with PCI P2P in virtio as consistent (e.g we don't imply any PCI stuff in virtio reset).

I think I can clarify. The consistency is that there's a single chapter that deals with migration, also hypervisors will all do exactly the same instead of each hypervisor guessing how to do migration and going its own way.

Quoted 4 lines
Quoted 3 lines

I actually
suggested ways to reduce duplication, by using transport offsets as tags.

I don't see a connection with P2P here. Or I may miss something.

I don't even know what P2P is in this context. Or why we are discussing it. Is this going to be another distraction that no one knows how it will work, just like mentioning TD randomly?

Quoted 5 lines
Quoted 3 lines

Finding a right balance means we all need to stop going to extremes, I wish you and lingshan would stop trying to force everyone to use registers and parav would stop trying to force dma.

There is a misunderstanding. Actually. I don't want to force registers.

You keep insisting on overlaying suspend functionality over the existing transport. For pci that is going to be in a register.

Quoted 11 lines

Which kind of interface is the best way to go is really implementation specific. In some implementations, registers are cheap but not virtqueue, in others, virtqueue is cheap but not register. They are all fine. But we can't not claim one proposal that is optimized for a specific implementation to be the best way. What I want to do is not limit the facilities that are used for live migration to any specific transport. I think Ling Shan agreed with me in this part. It needs to work on all interfaces regardless of registers, DMA, CMA or others. That's why I suggest we focus on what needs to be migrated first. That is define the following things

Quoted 8 lines

1) way to suspend/resume a device
2) virtqueue states, indices or inflight ones
3) device states

It is just like how we define virtqueues/features/status and other basic facilities where we do not tie it to any specific interfaces like DMA, CMA, registers or admin commands. Virtio benefited from the flexibility like this in the past so why not stick to that?

Because migration is a complex enough topic that we simply know from experience that
- things like error handling are needed
- passing big arrays around is needed
these just do not work reasonably well over registers and this is why admin commands were invented.

Quoted 6 lines

After this, each transport can choose to implement it in their own way. For example, if there's a proposal to use those via admin virtqueue that's fine.
And registers also fine and other transports.
That's why only the last patch of this series is dealing with the PCI specific part.

Maybe they are fine in theory. So far I didn't see anything cohesive that is close functionally being even to Parav's proposal of migration over admin commands. There's no specific *reason* not to do that, practically - I don't see why

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

and a layer violation.

layers are only good if they make sense.

Case by case, for example, PCI PM has defined the state and the interaction with P2P. Reusing that seems much cleaner than inventing a mechanism in the virtio layer. Or if it needs a side channel, it needs to be invented in PCI not virtio.

Thanks

Quoted 13 lines

There's no *if* in my opinion - migration is way easier for hypervisors to implement as a side channel so any device state can be migrated. And this is uniform across transports. Is it harder or easier for hardware to implement? We have a hardware vendor pushing a side channel approach so it seems likely they know what is good for hardware? If it is somehow nvidia specific - can we please have other vendors with actual plans implementing this hardware (and note this has nothing to do with VDPA - all this SUSPEND bit work is only useful for full offload) come forward and say "we don't support this, we support that"? Or is this for some unnamed vendors not on the TC? Maybe they should join the TC to influence the direction then. Because right now it looks like software guys telling hardware guys what is good for hardware and I don't see how this makes any sense.

I guess most of the TC members are SW experts and virtio is not only for HW, SW emulated virtio works for many years.

This spec defines behaviors of virtio devices, not RTL, not layout.

So I assume SW experts are qualified to comment here.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Thanks

Quoted 3 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#63 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Jason Wang
Quoted 4 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#64 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Quoted 9 lines

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#65 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 21 lines

From: Zhu, Lingshan <[email protected]>
Sent: Wednesday, November 22, 2023 7:22 AM

Quoted 2 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not make

sense.

Quoted 10 lines
Quoted 1 line

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Quoted 3 lines

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

My proposal is,
1. suspend bit (not state) to be controlled by the guest driver
2. this bit must be busy poll type. Meaning,
a. the driver must get acknowledgement from the device that the suspend operation is completed in the device. b. the driver must get acknowledgement from the device that the resume operation is completed in the device.

3. Not to confuse this with administrative mode active/stop/freeze set by the owner device during device migration

4. This feature is usable in power management use case and may be some other.

#66 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 20 lines · Parav Pandit
Quoted 20 lines

From: Zhu, Lingshan <[email protected]>
Sent: Wednesday, November 22, 2023 7:22 AM

Quoted 2 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not make

sense.

Quoted 10 lines
Quoted 1 line

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Quoted 5 lines
Quoted 3 lines

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

My proposal is,
1. suspend bit (not state) to be controlled by the guest driver

The guest can set SUSPEND bit for sure. However there is no reason to forbid host from setting SUSPEND.

The reason is, the live migration process should be transparent to the guest, that means the guest should be suspended first, then the host suspend the device, so no I/O errors in the guest.

Quoted 1 line

2. this bit must be busy poll type. Meaning,

This is already in the patch, the driver should re-read to make sure the SUSPEND bit is set.

Quoted 2 lines

a. the driver must get acknowledgement from the device that the suspend operation is completed in the device. b. the driver must get acknowledgement from the device that the resume operation is completed in the device.

Yes, by re-read, for example the device should only present SUSPEND bit in the device status when it finished the process to suspend, already in the patch series.

Quoted 4 lines

3. Not to confuse this with administrative mode active/stop/freeze set by the owner device during device migration

4. This feature is usable in power management use case and may be some other.

Yes, as long as we use virtio status to control PM, rather than the reverse.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#67 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 27 lines

From: Zhu, Lingshan <[email protected]>
Sent: Wednesday, November 22, 2023 3:34 PM

Quoted 22 lines · Parav Pandit
Quoted 22 lines

From: Zhu, Lingshan <[email protected]>
Sent: Wednesday, November 22, 2023 7:22 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 2 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log

and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Instead of claiming it as some non_device_migration facility does not make

sense.

Quoted 10 lines
Quoted 1 line

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

My proposal is,
1. suspend bit (not state) to be controlled by the guest driver

The guest can set SUSPEND bit for sure. However there is no reason to forbid host from setting SUSPEND.

Sure. hypervisor can also touch all the bits it has access to.

Quoted 4 lines

The reason is, the live migration process should be transparent to the guest, that means the guest should be suspended first, then the host suspend the device, so no I/O errors in the guest.

I explained this yday to my best, that hypervisor in my proposal also must touch the device when the guest is NOT suspended. This is helping to lower the downtime as base tenet.

(you can imagine as the pre-copy phase of the device context like how there is pre-copy is present for the memory).

so guest vcpus to suspend first before device is smaller case of what my proposal covers. And it is fine.

I am ok with guest controlled suspend bit, that optionally may be used by the hypervisor.

Quoted 11 lines
Quoted 1 line

2. this bit must be busy poll type. Meaning,

This is already in the patch, the driver should re-read to make sure the SUSPEND bit is set.

Quoted 1 line

a. the driver must get acknowledgement from the device that the suspend

operation is completed in the device.

Quoted 1 line

b. the driver must get acknowledgement from the device that the resume

operation is completed in the device.
Yes, by re-read, for example the device should only present SUSPEND bit in the device status when it finished the process to suspend, already in the patch series.

Quoted 1 line
Quoted 6 lines
Quoted 4 lines

3. Not to confuse this with administrative mode active/stop/freeze set by the owner device during device migration

4. This feature is usable in power management use case and may be some

other.
Yes, as long as we use virtio status to control PM, rather than the reverse.

PCI PM is already there. The extra optional suspend bit is an aid to those virtio device which cannot meet the deadlines in 10msec timing.

#68 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Zhu, Lingshan
Quoted 16 lines · Lingshan
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Quoted 9 lines

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Quoted 3 lines

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

That would be one example.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#69 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 16 lines · Michael S. Tsirkin
Quoted 15 lines · Lingshan
Quoted 13 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Quoted 4 lines
Quoted 3 lines

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

That would be one example.

OK, I will look into this.
Roughly say in transport-pci.tex: When SUSPEND, the device MAY optionally enter a power-saving state.

Please allow me some time working on the details

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#70 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 22 lines · Lingshan
Quoted 19 lines · Michael S. Tsirkin
Quoted 18 lines · Lingshan
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

It is used for migration for sure.

Quoted 9 lines

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail. Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?
Thanks!

Do you mean letting the device enter a new power state when SUSPEND, and such description in transport-pci.tex? Then resume normal state on DRIVER_OK.

Quoted 7 lines
Quoted 1 line

That would be one example.

OK, I will look into this.
Roughly say in transport-pci.tex: When SUSPEND, the device MAY optionally enter a
power-saving state.

Please allow me some time working on the details

Just this is likely not sufficient. I am not 100% sure what is wanted here but let me try to guess - unlike normal suspend, this special state is actually controlled by hypervisor.

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#71 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Michael S. Tsirkin
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
Quoted 2 lines

Lingshan claimed that suspending device is for live migration in commit log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc. Instead of claiming it as some non_device_migration facility does not make sense.

Quoted 7 lines
Quoted 1 line

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

Thanks

Quoted 8 lines

Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are? Thanks!

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#72 lore raw

RE: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 16 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 3 lines
Quoted 2 lines

It is used for migration for sure.

Quoted 9 lines
Quoted 5 lines

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

MMIO should implement PM like other transport. That brings the equivalency principle.

Quoted 6 lines

Thanks

Quoted 3 lines

Parav did you indicate at some point a virtio specific SUSPEND bit can be useful for PM? Could you share how it's better than transport level PM and what the requirements are?

The practical reason for having suspend bit is,
Some devices may not be able to support Immediate_Readiness_on_Return_to_D0. This is because the context may be huge to finish restoring in 10msec.

Hence, the complex devices rely on device specific bit to ensure that the device is ready.

This is why suspend bit under direct guest control is useful.

This must not be confused with the hypervisor controlled active/stop/freeze mode to drive during device migration.

#73 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 23 lines · Parav Pandit
Quoted 23 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 8 lines
Quoted 2 lines

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

Quoted 5 lines
Quoted 3 lines

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

MMIO should implement PM like other transport. That brings the equivalency principle.

MMIO are usually platform devices. I don't see the point.

Thanks

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#74 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 27 lines · Jason Wang
Quoted 26 lines · Parav Pandit
Quoted 26 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 8 lines
Quoted 2 lines

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

Quoted 6 lines
Quoted 2 lines

MMIO should implement PM like other transport. That brings the equivalency principle.

MMIO are usually platform devices. I don't see the point.

Thanks

I don't understand what you are saying. Why does it make sense to suspend individual platform devices when they are suspended with the whole platform?

Signature · 18 lines
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#75 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 32 lines · Michael S. Tsirkin
Quoted 30 lines · Jason Wang
Quoted 28 lines · Parav Pandit
Quoted 17 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 3 lines
Quoted 2 lines

It is used for migration for sure.

Quoted 9 lines
Quoted 5 lines

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

MMIO should implement PM like other transport. That brings the equivalency principle.

Quoted 7 lines
Quoted 3 lines

MMIO are usually platform devices. I don't see the point.

Thanks

I don't understand what you are saying. Why does it make sense to suspend individual platform devices when they are suspended with the whole platform?

It is because we don't need to suspend the whole platform to migrate the virtio-MMIO device.

Thanks

Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#76 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 26 lines · Jason Wang
Quoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Jason Wang
Quoted 23 lines · Parav Pandit
Quoted 12 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 2 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

MMIO should implement PM like other transport. That brings the equivalency principle.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

MMIO are usually platform devices. I don't see the point.

Thanks

I don't understand what you are saying. Why does it make sense to suspend individual platform devices when they are suspended with the whole platform?

It is because we don't need to suspend the whole platform to migrate the virtio-MMIO device.

I agree, should only need to suspend the device

Quoted 6 lines

Thanks

Quoted 3 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#77 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

In reply to Jason Wang
Quoted 37 lines · Jason Wang
Quoted 36 lines · Michael S. Tsirkin
Quoted 33 lines · Jason Wang
Quoted 23 lines · Parav Pandit
Quoted 23 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 8 lines
Quoted 2 lines

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

Quoted 5 lines
Quoted 3 lines

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

MMIO should implement PM like other transport. That brings the equivalency principle.

MMIO are usually platform devices. I don't see the point.

Thanks

Quoted 8 lines
Quoted 3 lines

I don't understand what you are saying. Why does it make sense to suspend individual platform devices when they are suspended with the whole platform?

It is because we don't need to suspend the whole platform to migrate the virtio-MMIO device.

Thanks

We were talking about uses beyond migration.

Quoted 4 lines
Quoted 4 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#78 lore raw

Re: [virtio-comment] RE: [PATCH V2 3/6] virtio: dont reset vqs when SUSPEND

Quoted 43 lines · Michael S. Tsirkin
Quoted 41 lines · Jason Wang
Quoted 39 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Parav Pandit
Quoted 26 lines

From: Jason Wang <[email protected]>
Sent: Wednesday, November 22, 2023 10:59 AM

Quoted 3 lines · Michael S. Tsirkin
Quoted 1 line · Jason Wang
Quoted 1 line

Lingshan claimed that suspending device is for live migration in commit

log and in discussion he portray it as some basic facility unrelated to device migration such as debug etc.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Instead of claiming it as some non_device_migration facility does not

make sense.

Quoted 8 lines
Quoted 2 lines

It is used for migration for sure.

Well having a generic facility to stop device sounds like a nice thing. However the devil is in the detail. A lot of detail here seems very much tailored to a very specific implementation in mind.
So thinking through how it will work e.g. for power management would be a good excercise to figure out how it should work in detail.

It might work in the case where there's no PM support in the transport. E.g for MMIO devices.

Quoted 6 lines
Quoted 2 lines

MMIO should implement PM like other transport. That brings the equivalency principle.

MMIO are usually platform devices. I don't see the point.

Thanks

I don't understand what you are saying. Why does it make sense to suspend individual platform devices when they are suspended with the whole platform?

Quoted 6 lines
Quoted 4 lines

It is because we don't need to suspend the whole platform to migrate the virtio-MMIO device.

Thanks

We were talking about uses beyond migration.

For example, vm stop/cont.

Thanks

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

--
MST

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#79 lore raw

PATCH v2 4/6 virtio-pci: implement VIRTIO_F_QUEUE_STATE

In reply to Zhu Lingshan

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
 transport-pci.tex | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
transport-pci.tex +18 -0
index a5c6719..3161519 100644
@@ -325,6 +325,10 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport
         /* About the administration virtqueue. */
         le16 admin_queue_index;         /* read-only for driver */
         le16 admin_queue_num;         /* read-only for driver */
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */
 };
 \end{lstlisting}
 
@@ -428,6 +432,17 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport
 	The value 0 indicates no supported administration virtqueues.
 	This field is valid only if VIRTIO_F_ADMIN_VQ has been
 	negotiated.
+
+\item[\field{queue_avail_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the available state of
+        the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
+\item[\field{queue_used_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the used state of the
+        virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
 \end{description}
 
 \devicenormative{\paragraph}{Common configuration structure layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout}
@@ -488,6 +503,9 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport
 present either a value of 0 or a power of 2 in
 \field{queue_size}.
 
+If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST ignore
+any accesses to \field{queue_avail_state} and \field{queue_used_state}.
+
 If VIRTIO_F_ADMIN_VQ has been negotiated, the value
 \field{admin_queue_index} MUST be equal to, or bigger than
 \field{num_queues}; also, \field{admin_queue_num} MUST be
Signature · 18 lines
2.35.3


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#80 lore raw

[virtio-comment] RE: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 20 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
 transport-pci.tex | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 4 lines
transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does not work effectively. There are inflight out of order descriptors for block also.
Hence toy registers like this do not work.

Series [1] is comprehensive that covers it even if you consider non-passtrhough device migration model. Where you can suspend individual queues using new admin command and get them in the device context state.

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

Quoted 31 lines

};
\end{lstlisting}

transport-pci.tex +0 -0
@@ -428,6 +432,17 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport

transport-pci.tex +11 -0
 	The value 0 indicates no supported administration virtqueues.
 	This field is valid only if VIRTIO_F_ADMIN_VQ has been
 	negotiated.
+
+\item[\field{queue_avail_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the available state of
+        the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
+\item[\field{queue_used_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the used state of the
+        virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
 \end{description}
 
 \devicenormative{\paragraph}{Common configuration structure layout}{Virtio

Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout} @@ -488,6 +503,9 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport present either a value of 0 or a power of 2 in \field{queue_size}.

transport-pci.tex +3 -0
+If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST ignore
+any accesses to \field{queue_avail_state} and \field{queue_used_state}.
+
 If VIRTIO_F_ADMIN_VQ has been negotiated, the value
Quoted 4 lines

\field{admin_queue_index} MUST be equal to, or bigger than \field{num_queues}; also, \field{admin_queue_num} MUST be --
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#81 lore raw

[virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
  transport-pci.tex | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
Quoted 15 lines

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 12 lines
transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does not work effectively. There are inflight out of order descriptors for block also.
Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work? Like how to set a queue size and enable it?

Quoted 5 lines

Series [1] is comprehensive that covers it even if you consider non-passtrhough device migration model. Where you can suspend individual queues using new admin command and get them in the device context state.

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.html

I suggest you read QEMU migration code. If you don't want to, not my fault.

Quoted 28 lines
Quoted 28 lines
  };
  \end{lstlisting}
transport-pci.tex +0 -0
@@ -428,6 +432,17 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
The value 0 indicates no supported administration virtqueues. This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated.

transport-pci.tex +11 -0
+
+\item[\field{queue_avail_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the available state of
+        the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
+\item[\field{queue_used_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the used state of the
+        virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
  \end{description}
 
  \devicenormative{\paragraph}{Common configuration structure layout}{Virtio

Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout} @@ -488,6 +503,9 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport present either a value of 0 or a power of 2 in \field{queue_size}.

Quoted 8 lines
Quoted 8 lines
transport-pci.tex +3 -0
+If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST ignore
+any accesses to \field{queue_avail_state} and \field{queue_used_state}.
+
  If VIRTIO_F_ADMIN_VQ has been negotiated, the value

\field{admin_queue_index} MUST be equal to, or bigger than \field{num_queues}; also, \field{admin_queue_num} MUST be --
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#82 lore raw

RE: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 31 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
  transport-pci.tex | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
Quoted 14 lines

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 13 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it was introduced so that live migration can _actually_ work.

When queue_select is done for 128 queues serially, it take a lot of time to read those slow register interface for this + inflight descriptors + more.

Quoted 1 line

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time registers. Not to keep abusing them..

Quoted 64 lines
Quoted 2 lines

Series [1] is comprehensive that covers it even if you consider non-

passtrhough device migration model.

Quoted 1 line

Where you can suspend individual queues using new admin command and get

them in the device context state.

Quoted 4 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.h
tml

I suggest you read QEMU migration code. If you don't want to, not my fault.

Quoted 22 lines
Quoted 22 lines
  };
  \end{lstlisting}
transport-pci.tex +0 -0
@@ -428,6 +432,17 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
The value 0 indicates no supported administration virtqueues. This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated.

transport-pci.tex +11 -0
+
+\item[\field{queue_avail_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the available state of
+        the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
+\item[\field{queue_used_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the used state of the
+        virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
  \end{description}
Quoted 5 lines
Quoted 5 lines

\devicenormative{\paragraph}{Common configuration structure
layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout} @@ -488,6 +503,9 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport present either a value of 0 or a power of 2

in \field{queue_size}.

Quoted 3 lines

transport-pci.tex

Quoted 3 lines
transport-pci.tex +2 -0
+If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST
+ignore any accesses to \field{queue_avail_state} and

\field{queue_used_state}.

Quoted 6 lines
Quoted 6 lines

+
If VIRTIO_F_ADMIN_VQ has been negotiated, the value
\field{admin_queue_index} MUST be equal to, or bigger than \field{num_queues}; also, \field{admin_queue_num} MUST be --
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#83 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 31 lines · Parav Pandit
Quoted 31 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
   transport-pci.tex | 18 ++++++++++++++++++
   1 file changed, 18 insertions(+)
Quoted 14 lines

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 13 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

not work effectively.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it was introduced so that live migration can _actually_ work.

When queue_select is done for 128 queues serially, it take a lot of time to read those slow register interface for this + inflight descriptors + more.

interesting, virtio work in this pattern for many years, right?

Quoted 4 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time registers. Not to keep abusing them..

don't you need to set queue_size at the destination side?

Quoted 52 lines
Quoted 52 lines
Quoted 2 lines

Series [1] is comprehensive that covers it even if you consider non-

passtrhough device migration model.

Quoted 1 line

Where you can suspend individual queues using new admin command and get

them in the device context state.

Quoted 3 lines

[1]
https://lists.oasis-open.org/archives/virtio-comment/202310/msg00472.h
tml

I suggest you read QEMU migration code. If you don't want to, not my fault.

Quoted 21 lines
Quoted 21 lines
   };
   \end{lstlisting}
transport-pci.tex +0 -0
@@ -428,6 +432,17 @@ \subsubsection{Common configuration structure

layout}\label{sec:Virtio Transport
The value 0 indicates no supported administration virtqueues. This field is valid only if VIRTIO_F_ADMIN_VQ has been negotiated.

transport-pci.tex +11 -0
+
+\item[\field{queue_avail_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the available state of
+        the virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
+\item[\field{queue_used_state}]
+        This field is valid only if VIRTIO_F_QUEUE_STATE has been
+        negotiated. The driver sets and gets the used state of the
+        virtqueue here (see \ref{sec:Virtqueues / Virtqueue State}).
+
   \end{description}
Quoted 5 lines
Quoted 5 lines

\devicenormative{\paragraph}{Common configuration structure
layout}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Common configuration structure layout} @@ -488,6 +503,9 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport present either a value of 0 or a power of 2

in \field{queue_size}.

Quoted 2 lines

transport-pci.tex

Quoted 2 lines
transport-pci.tex +2 -0
+If VIRTIO_F_QUEUE_STATE has not been negotiated, the device MUST
+ignore any accesses to \field{queue_avail_state} and

\field{queue_used_state}.

Quoted 6 lines
Quoted 6 lines

+
If VIRTIO_F_ADMIN_VQ has been negotiated, the value
\field{admin_queue_index} MUST be equal to, or bigger than \field{num_queues}; also, \field{admin_queue_num} MUST be --
2.35.3

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Quoted 8 lines
Quoted 8 lines

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#84 lore raw

RE: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 42 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
   transport-pci.tex | 18 ++++++++++++++++++
   1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 15 lines
Quoted 15 lines
Quoted 10 lines

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

Quoted 7 lines
Quoted 2 lines

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of queues were not in hw. Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding them. So all these years do not matter.

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all queues must be created before the driver_ok phase. Queue_reset was last moment exception.

#85 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 41 lines · Parav Pandit
Quoted 41 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
    transport-pci.tex | 18 ++++++++++++++++++
    1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 15 lines
Quoted 15 lines
Quoted 10 lines

transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 331

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

was introduced so that live migration can _actually_ work.

Quoted 1 line

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of queues were not in hw.

The registers are control path in config space, how 400G or 800G affect?? See the virtio common cfg, you will find the max number of vqs is there, num_queues.

Quoted 3 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding them. So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism? Are you questioning virito-pci fundamentals???

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all queues must be created before the driver_ok phase. Queue_reset was last moment exception.

create a queue? Nvidia specific?

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

Quoted 1 line

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#86 lore raw

RE: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 49 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 44 lines · Parav Pandit
Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
    transport-pci.tex | 18 ++++++++++++++++++
    1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

Quoted 2 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

Quoted 7 lines
Quoted 2 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Huh. No.
Do git log and realize what happened with queue_reset.

Quoted 2 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

#87 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 53 lines · Parav Pandit
Quoted 53 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 49 lines · Parav Pandit
Quoted 49 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
     transport-pci.tex | 18 ++++++++++++++++++
     1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 8 lines
Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

This is not dynamically, it only happens when SUSPEND and RESUME.
This is the same mechanism how virtio initialize a virtqueue, working for many years.

Quoted 4 lines
Quoted 2 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

the driver need to initialize them anyway.

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

Quoted 6 lines
Quoted 4 lines

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Huh. No.
Do git log and realize what happened with queue_reset.

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 4 lines
Quoted 3 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#88 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 59 lines · Lingshan
Quoted 56 lines · Parav Pandit
Quoted 56 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 44 lines · Parav Pandit
Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
     transport-pci.tex | 18 ++++++++++++++++++
     1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

Quoted 6 lines
Quoted 5 lines

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Quoted 7 lines
Quoted 4 lines

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

This is not dynamically, it only happens when SUSPEND and RESUME. This is the same mechanism how virtio initialize a virtqueue, working for many years.

I wish we just had a transport vq already. That's the way to solve this not fighting individual bits.

Quoted 32 lines
Quoted 4 lines
Quoted 2 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

the driver need to initialize them anyway.

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

Quoted 6 lines
Quoted 4 lines

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Huh. No.
Do git log and realize what happened with queue_reset.

Quoted 7 lines

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 4 lines
Quoted 3 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#89 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 61 lines · Michael S. Tsirkin
Quoted 60 lines · Lingshan
Quoted 58 lines · Parav Pandit
Quoted 48 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 44 lines · Parav Pandit
Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
      transport-pci.tex | 18 ++++++++++++++++++
      1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Because those are the one in practice requires large number of VQs.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

This is not dynamically, it only happens when SUSPEND and RESUME. This is the same mechanism how virtio initialize a virtqueue, working for many years.

I wish we just had a transport vq already. That's the way to solve this not fighting individual bits.

Yeah, I agree, transport is a queued task(sent out V4 months ago...), one by one... hard and tough work...

Quoted 29 lines
Quoted 29 lines
Quoted 5 lines
Quoted 3 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

the driver need to initialize them anyway.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 13 lines
Quoted 13 lines
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Huh. No.
Do git log and realize what happened with queue_reset.

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 3 lines
Quoted 2 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#90 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 66 lines · Lingshan
Quoted 63 lines · Michael S. Tsirkin
Quoted 62 lines · Lingshan
Quoted 60 lines · Parav Pandit
Quoted 48 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 44 lines · Parav Pandit
Quoted 44 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
      transport-pci.tex | 18 ++++++++++++++++++
      1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This is not dynamically, it only happens when SUSPEND and RESUME. This is the same mechanism how virtio initialize a virtqueue, working for many years.

I wish we just had a transport vq already. That's the way to solve this not fighting individual bits.

Yeah, I agree, transport is a queued task(sent out V4 months ago...), one by one... hard and tough work...

Frankly I think that should take precedence, then Parav will not get annoyed each time add a couple of registers.

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 4 lines
Quoted 2 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

the driver need to initialize them anyway.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 13 lines
Quoted 13 lines
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Huh. No.
Do git log and realize what happened with queue_reset.

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 3 lines
Quoted 2 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#91 lore raw

Re: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 68 lines · Michael S. Tsirkin
Quoted 67 lines · Lingshan
Quoted 65 lines · Michael S. Tsirkin
Quoted 64 lines · Lingshan
Quoted 53 lines · Parav Pandit
Quoted 53 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 49 lines · Parav Pandit
Quoted 49 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 16 lines · Parav Pandit
Quoted 16 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 11 lines · Parav Pandit
Quoted 11 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration structure to support VIRTIO_F_QUEUE_STATE in PCI transport layer.

---
       transport-pci.tex | 18 ++++++++++++++++++
       1 file changed, 18 insertions(+)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

transport-pci.tex \subsubsection{Common configuration

Quoted 5 lines
transport-pci.tex index renamed from transport-pci.tex +0 -0

a5c6719..3161519 100644

transport-pci.tex +0 -0
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

transport-pci.tex

Quoted 8 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver */
le16 admin_queue_num; /* read-only for driver */

transport-pci.tex +4 -0
+
+	/* Virtqueue state */
+        le16 queue_avail_state;         /* read-write */
+        le16 queue_used_state;          /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

Quoted 8 lines
Quoted 5 lines

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors + more. interesting, virtio work in this pattern for many years, right?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G affect??

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically via this one vq at a time, serializing all the operations. It does not scale well with high q count.

This is not dynamically, it only happens when SUSPEND and RESUME. This is the same mechanism how virtio initialize a virtqueue, working for many years.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I wish we just had a transport vq already. That's the way to solve this not fighting individual bits.

Yeah, I agree, transport is a queued task(sent out V4 months ago...), one by one... hard and tough work...

Frankly I think that should take precedence, then Parav will not get annoyed each time add a couple of registers.

I agree, things can happen and we are already here..

Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 5 lines
Quoted 3 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

the driver need to initialize them anyway.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this mechanism?
Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 13 lines
Quoted 13 lines
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

create a queue? Nvidia specific?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Huh. No.
Do git log and realize what happened with queue_reset.

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 3 lines
Quoted 2 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters, not to create.

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#92 lore raw

RE: [virtio-comment] Re: [PATCH V2 4/6] virtio-pci: implement VIRTIO_F_QUEUE_STATE

Quoted 82 lines

From: Zhu, Lingshan <[email protected]>
Sent: Friday, November 10, 2023 12:23 PM

Quoted 18 lines · Michael S. Tsirkin
Quoted 17 lines · Lingshan
Quoted 15 lines · Michael S. Tsirkin
Quoted 14 lines · Lingshan
Quoted 13 lines · Parav Pandit
Quoted 13 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 2:57 PM

Quoted 9 lines · Parav Pandit
Quoted 9 lines

From: Zhu, Lingshan <[email protected]>
Sent: Monday, November 6, 2023 9:01 AM

Quoted 5 lines · Parav Pandit
Quoted 5 lines

From: [email protected] <[email protected] open.org> On Behalf Of Zhu, Lingshan
Sent: Friday, November 3, 2023 8:27 PM

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Parav Pandit
Quoted 5 lines
Quoted 5 lines

From: Zhu Lingshan <[email protected]>
Sent: Friday, November 3, 2023 4:05 PM

This patch adds two new le16 fields to common configuration
structure to support VIRTIO_F_QUEUE_STATE in PCI transport

layer.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Signed-off-by: Zhu Lingshan <[email protected]>
---
transport-pci.tex | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/transport-pci.tex b/transport-pci.tex index
a5c6719..3161519 100644
--- a/transport-pci.tex
+++ b/transport-pci.tex
@@ -325,6 +325,10 @@ \subsubsection{Common configuration

structure

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

layout}\label{sec:Virtio Transport
/* About the administration virtqueue. */
le16 admin_queue_index; /* read-only for driver

*/

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

le16 admin_queue_num; /* read-only for driver

*/

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

+
+ /* Virtqueue state */
+ le16 queue_avail_state; /* read-write */
+ le16 queue_used_state; /* read-write */

This tiny interface for 128 virtio net queues through register read writes, does

not work effectively.

Quoted 2 lines

There are inflight out of order descriptors for block also. Hence toy registers like this do not work.

Do you know there is a queue_select? Why this does not work? Do you know how other queue related fields work?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

:)
Yes. If you notice queue_reset related critical spec bug fix was done when it

was introduced so that live migration can _actually_ work.

Quoted 2 lines

When queue_select is done for 128 queues serially, it take a lot of time to

read those slow register interface for this + inflight descriptors +

more.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

interesting, virtio work in this pattern for many years, right?

All these years 400Gbps and 800Gbps virtio was not present, number of

queues were not in hw.
The registers are control path in config space, how 400G or 800G

affect??

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Because those are the one in practice requires large number of VQs.

You are asking per VQ register commands to modify things dynamically

via this one vq at a time, serializing all the operations.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

It does not scale well with high q count.

This is not dynamically, it only happens when SUSPEND and RESUME. This is the same mechanism how virtio initialize a virtqueue, working for many years.

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I wish we just had a transport vq already. That's the way to solve this not fighting individual bits.

Yeah, I agree, transport is a queued task(sent out V4 months ago...), one by one... hard and tough work...

Frankly I think that should take precedence, then Parav will not get annoyed each time add a couple of registers.

I agree, things can happen and we are already here..

Unfortunately transport vq is of not much help for below fundamental reasons.

1.1 as it involves many VMEXITS of accessing runtime config spaced on slow registers.
1.2 or alternatively hypervisor end up polling may thousands of registers wasting cpu resources.
2. It does not help of future CC use case where hypervisor must not be involved in dynamic config
3. Complex device like vnet has already stopped using every growing config space and using cvq, large part of work in 1.3 has shown that already
4. PFs also cannot infinitely grow registers, they also need less on-die registers.

And who knows the backward compatible SIOV devices may offer same bar as VFs.

virto spec has already outlined this efficient concept in the spec and TC members are already following it.

SIOV for non-backward compatible mode, anyway, need new interface and vq is inherently already there which fulfilling the needs.

Quoted 41 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

See the virtio common cfg, you will find the max number of vqs is there, num_queues.

:)
Sure. those values at high q count affects.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

the driver need to initialize them anyway.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

Device didn’t support LM.
Many limitations existed all these years and TC is improving and expanding

them.

Quoted 1 line

So all these years do not matter.

Not sure what are you talking about, haven't we initialize the device and vqs in config space for years?????? What's wrong with this

mechanism?

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 2 lines
Quoted 1 line

Are you questioning virito-pci fundamentals???

Don’t point to in-efficient past to establish similar in-efficient future.

interesting, you know this is a one-time thing, right? and you are aware of this has been there for years.

Quoted 12 lines
Quoted 12 lines
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Like how to set a queue size and enable it?

Those are meant to be used before DRIVER_OK stage as they are init time

registers.

Quoted 1 line

Not to keep abusing them..

don't you need to set queue_size at the destination side?

No.
But the src/dst does not matter.
Queue_size to be set before DRIVER_OK like rest of the registers, as all

queues must be created before the driver_ok phase.

Quoted 1 line

Queue_reset was last moment exception.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

create a queue? Nvidia specific?

Huh. No.
Do git log and realize what happened with queue_reset.

You didn't answer the question, does the spec even has defined "create a vq"?

Quoted 2 lines
Quoted 2 lines

For standard virtio, you need to read the number of enabled vqs at the source side, then enable them at the dst, so queue_size matters,

not to create.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

All that happens in the pre-copy phase.

Yes and how your answer related to this discussion?