OASIS Virtual I/O Device (VIRTIO) TC

 View Only
Expand all | Collapse all

[OASIS Issue Tracker] (VIRTIO-134) Make it clear how chained indirect descriptors must work.

  • 1.  [OASIS Issue Tracker] (VIRTIO-134) Make it clear how chained indirect descriptors must work.

    Posted 02-13-2015 02:40
    Rusty Russell created VIRTIO-134: ------------------------------------ Summary: Make it clear how chained indirect descriptors must work. Key: VIRTIO-134 URL: https://issues.oasis-open.org/browse/VIRTIO-134 Project: OASIS Virtual I/O Device (VIRTIO) TC Issue Type: Bug Affects Versions: virtio 1.0 cs02, virtio 1.0 cs01, virtio 1.0 csprd03 Reporter: Rusty Russell Chained indirect descriptors were partially banned by virtio-15, which said how devices would handle them (by terminating the descriptor when it hits the end of the indirect descriptors). It didn't spell out that (obviously) they shouldn't be generated by drivers! It also leaves open the possibility of one or more direct descriptors followed by a trailing indirect descriptor. All implementations I know of handle this, though none I know of generate such things. My test lguest implementation didn't (now fixed); we should spell out explicitly that it's possible. -- This message was sent by Atlassian JIRA (v6.2.2#6258)


  • 2.  [PATCH] VIRTIO-134: Spell out details of indirect elements in chains

    Posted 02-13-2015 03:08
    1) It's implied that a chain terminates with an indirect descriptor (since VIRTIO-15) but we didn't spell out that a device MUST NOT continue it. 2) We allow [direct]->[direct]->[indirect], and qemu and bhyve both accept it. Make it clear that this is valid, thus devices MUST handle it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- content.tex 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content.tex b/content.tex index 5b54c68..6ba079d 100644 --- a/content.tex +++ b/content.tex @@ -475,9 +475,21 @@ one table per descriptor). A driver MUST NOT create a descriptor chain longer than the Queue Size of the device. +A driver MUST NOT set both VIRTQ_DESC_F_INDIRECT and VIRTQ_DESC_F_NEXT +in field{flags}. + devicenormative{paragraph}{Indirect Descriptors}{Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Descriptor Table / Indirect Descriptors} The device MUST ignore the write-only flag (field{flags}&VIRTQ_DESC_F_WRITE) in the descriptor that refers to an indirect table. +The device MUST handle the case of zero or more normal chained +descriptors followed by a single descriptor with field{flags}&VIRTQ_DESC_F_INDIRECT. + +egin{note} +While unusual (most implementations either create a chain solely using +non-indirect descriptors, or use a single indirect element), such a +layout is valid. +end{note} + subsection{The Virtqueue Available Ring}label{sec:Basic Facilities of a Virtio Device / Virtqueues / The Virtqueue Available Ring} egin{lstlisting} -- 2.1.0