You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\item\field{dev_num}: For Transport Messages, the target device number; for
396
-
Bus Messages MUST be zero.
397
-
\item\field{token}: Non-zero for requests (which expect a response); zero
398
-
MUST be used only for event (one-way) messages. Responses
399
-
MUST echo the request's \field{token}.
400
-
\item\field{msg_size}: Total size in bytes of the complete message (header +
401
-
payload). MUST be \(\ge 8\) and MUST NOT exceed the
402
-
bus's maximum message size.
403
-
\item\field{payload}: Operation-specific data. Unused trailing bytes (if any
404
-
introduced by a bus framing) MUST be zero and MUST be
405
-
ignored by receivers.
395
+
\item\field{dev_num}: For transport messages, the device number that should
396
+
receive the message. Bus messages operate on device number 0.
397
+
\item\field{token}: Requests use non-zero tokens so responses can be matched;
398
+
event (one-way) messages use token 0 and do not expect a response.
399
+
\item\field{msg_size}: Total size in bytes of the complete message (header
400
+
plus payload).
401
+
\item\field{payload}: Operation-specific data. If a bus introduces extra
402
+
padding bytes, those bytes are not part of the payload semantics.
406
403
\end{itemize}
407
404
408
-
All reserved header bits and any unspecified header values MUST be
409
-
sent as zero and MUST be ignored on receive to preserve forward
410
-
compatibility.
405
+
\drivernormative{\paragraph}{Common Header (Driver)}{Virtio Transport Options / Virtio Over Messages / Basic Concepts / Common Message Format / Driver}
406
+
\begin{itemize}
407
+
\item A driver MUST set bits 2..7 of \field{type} to zero and MUST treat them as reserved when
408
+
parsing received headers.
409
+
\item A driver MUST ensure \field{msg_size} reflects the total message length (header plus payload)
410
+
and MUST NOT exceed the maximum message size advertised by the bus instance.
411
+
\item A driver MUST set \field{token}=0 for event (one-way) messages and MUST assign a non-zero
412
+
\field{token} for every request that expects a response.
413
+
\item When sending a transport message, a driver MUST set \field{dev_num} to the intended device
414
+
number.
415
+
\item If a driver introduces padding bytes that become part of the transport payload, it MUST set
416
+
those bytes to zero.
417
+
\end{itemize}
418
+
419
+
\devicenormative{\paragraph}{Common Header (Device)}{Virtio Transport Options / Virtio Over Messages / Basic Concepts / Common Message Format / Device}
420
+
\begin{itemize}
421
+
\item A device MUST set bits 2..7 of \field{type} to zero in transmitted messages and MUST ignore
422
+
those bits on receive.
423
+
\item A device MUST ensure \field{msg_size} reflects the total message length (header plus payload)
424
+
and does not exceed the bus's advertised maximum.
425
+
\item A device MUST set \field{token}=0 for event (one-way) messages it originates and MUST echo
426
+
the \field{token} received in requests when producing responses.
427
+
\item When sending a transport message, a device MUST set \field{dev_num} to its own device number.
428
+
\item A device MUST ignore padding bytes that are documented as bus-specific and MUST zero any such
429
+
bytes it introduces into the transport payload.
430
+
\end{itemize}
431
+
432
+
\busnormative{\paragraph}{Common Header (Bus)}{Virtio Transport Options / Virtio Over Messages / Basic Concepts / Common Message Format / Bus}
433
+
\begin{itemize}
434
+
\item A bus implementation MUST deliver bus messages with \field{dev_num}=0 and MUST NOT alter
435
+
\field{dev_num} for transport messages beyond the routing needed to reach the addressed
436
+
device.
437
+
\item A bus implementation MUST set bits 2..7 of \field{type} to zero when generating bus messages
438
+
and MUST ignore those bits when forwarding transport messages.
439
+
\item If the bus adds framing or padding bytes around the common header or payload, it MUST set
440
+
those bytes to zero before delivering the message to the opposite side and MUST present the
441
+
same zero padding when the opposite side reads a message.
442
+
\end{itemize}
443
+
444
+
Reserved header bits and unspecified header values MUST be transmitted as zero and ignored on
0 commit comments