Skip to content

Commit 4eac1c2

Browse files
virtio-msg: clarify GET_SHM support and shmid semantics
Require devices to implement GET_SHM even though drivers may treat it as optional, rename the shared-memory region identifier fields to shmid to match core virtio terminology, and define unsupported shmid responses as zero-length regions. This makes shared-memory capability discovery explicit and keeps unsupported-region handling deterministic for drivers. Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
1 parent 51d37c3 commit 4eac1c2

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

transport-msg.tex

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,13 +1294,18 @@ \subsubsection{Overview}
12941294
\msgref{GET_DEVICE_FEATURES}, \msgref{SET_DRIVER_FEATURES},
12951295
\msgref{GET_CONFIG}, \msgref{SET_CONFIG}, \msgref{GET_DEVICE_STATUS},
12961296
\msgref{SET_DEVICE_STATUS}, \msgref{GET_VQUEUE}, \msgref{SET_VQUEUE},
1297-
and \msgref{RESET_VQUEUE}.
1297+
\msgref{RESET_VQUEUE}, and \msgref{GET_SHM}.
12981298
\end{itemize}
12991299

13001300
\drivernormative{\paragraph}{Core Messages}{Virtio Transport Options / Virtio Over Messages / Transport Messages / Mandatory / Driver}
13011301
\begin{itemize}
1302-
\item A driver MUST support sending and interpreting the messages listed
1303-
above in order to initialize and operate a virtio-msg device.
1302+
\item A driver MUST support sending and interpreting
1303+
\msgref{GET_DEVICE_INFO}, \msgref{GET_DEVICE_FEATURES},
1304+
\msgref{SET_DRIVER_FEATURES}, \msgref{GET_CONFIG},
1305+
\msgref{SET_CONFIG}, \msgref{GET_DEVICE_STATUS},
1306+
\msgref{SET_DEVICE_STATUS}, \msgref{GET_VQUEUE},
1307+
\msgref{SET_VQUEUE}, and \msgref{RESET_VQUEUE} in order to
1308+
initialize and operate a virtio-msg device.
13041309
\end{itemize}
13051310

13061311
As described in Sections
@@ -1800,18 +1805,18 @@ \subsubsection{Overview}
18001805
\msgdef{GET_SHM}
18011806

18021807
\msgref{GET_SHM} returns the location and size of a device-owned shared memory
1803-
region. The request carries the region \field{index}; the response echoes
1804-
\field{index} and provides the base physical \field{address} and
1805-
\field{length}. A
1806-
\field{length} of zero indicates that the specified region does not exist.
1808+
region. The request carries the shared-memory region identifier
1809+
\field{shmid}; the response echoes \field{shmid} and provides the base
1810+
physical \field{address} and \field{length}. A \field{length} of zero
1811+
indicates that the specified \field{shmid} is not supported by the device.
18071812

18081813
\begin{lstlisting}
18091814
struct virtio_msg_get_shm_req {
1810-
le32 index; /* shared memory region index */
1815+
le32 shmid; /* shared memory region identifier */
18111816
};
18121817

18131818
struct virtio_msg_get_shm_resp {
1814-
le32 index; /* echoed index */
1819+
le32 shmid; /* echoed region identifier */
18151820
le32 reserved; /* must be zero */
18161821
le64 length; /* region length (0 if nonexistent) */
18171822
le64 address; /* region physical address */
@@ -1820,8 +1825,8 @@ \subsubsection{Overview}
18201825

18211826
\devicenormative{\paragraph}{GET\_SHM}{Virtio Transport Options / Virtio Over Messages / Transport Messages / VIRTIO_MSG_GET_SHM / Device}
18221827
\begin{itemize}
1823-
\item A device MUST return zero \field{length} if the requested shared memory
1824-
region does not exist and MUST report accurate physical
1828+
\item A device MUST return zero \field{length} if the requested
1829+
\field{shmid} is not supported and MUST report accurate physical
18251830
\field{address}/\field{length} information for regions it supports.
18261831
\item A device MUST set the \field{reserved} field in \msgref{GET_SHM}
18271832
responses to zero.

0 commit comments

Comments
 (0)