On Tue, Feb 18, 2025 at 12:00 PM Stefan Hajnoczi <stefa...@redhat.com> wrote: > > On Mon, Feb 17, 2025 at 05:40:12PM +0100, Albert Esteve wrote: > > Add MEM_READ/WRITE request to the vhost-user > > spec documentation. > > > > Signed-off-by: Albert Esteve <aest...@redhat.com> > > --- > > docs/interop/vhost-user.rst | 33 +++++++++++++++++++++++++++++++++ > > 1 file changed, 33 insertions(+) > > > > diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst > > index 96156f1900..9f7a2c4cf7 100644 > > --- a/docs/interop/vhost-user.rst > > +++ b/docs/interop/vhost-user.rst > > @@ -391,6 +391,7 @@ In QEMU the vhost-user message is implemented with the > > following struct: > > VhostUserTransferDeviceState transfer_state; > > VhostUserMMap mmap; > > VhostUserShMemConfig shmem; > > + VhostUserMemRWMsg mem_rw; > > Is this struct defined anywhere in the spec?
Ah, no, right. I did not see all the other structs defined, so I assumed some were just to be found in the code. But then it wouldn't serve as a specification... I realized I was not looking at the right section. VhostUserMMap is also missing, then. I will add them in the next iteration in their respective commits. > > > }; > > } QEMU_PACKED VhostUserMsg; > > > > @@ -1938,6 +1939,38 @@ is sent by the front-end. > > given range shall correspond to the entirety of a valid mapped region. > > A reply is generated indicating whether unmapping succeeded. > > > > +``VHOST_USER_BACKEND_MEM_READ`` > > + :id: 11 > > + :equivalent ioctl: N/A > > + :request payload: ``struct VhostUserMemRWMsg`` > > + :reply payload: N/A > > + > > + When the ``VHOST_USER_PROTOCOL_F_SHMEM`` protocol feature has been > > + successfully negotiated, this message can be submitted by the backends to > > + read a memory region that has failed to resolve a translation due to an > > + incomplete memory table, after another device called > > + ``VHOST_USER_BACKEND_SHMEM_MAP`` for the same region on a shared > > + descriptor file. > > + > > + This mechanism works as a fallback for resolving those memory > > + accesses and ensure that DMA works with Shared Memory Regions. > > + > > +``VHOST_USER_BACKEND_MEM_WRITE`` > > + :id: 12 > > + :equivalent ioctl: N/A > > + :request payload: ``struct VhostUserMemRWMsg`` > > + :reply payload: N/A > > + > > + When the ``VHOST_USER_PROTOCOL_F_SHMEM`` protocol feature has been > > + successfully negotiated, this message can be submitted by the backends to > > + write a memory region that has failed due to resolve a translation an > > + incomplete memory table after another device called > > + ``VHOST_USER_BACKEND_SHMEM_MAP`` for the same region on a shared > > + descriptor file. > > + > > + This mechanism works as a fallback for resolving those memory > > + accesses and ensure that DMA works with Shared Memory Regions. > > + > > .. _reply_ack: > > > > VHOST_USER_PROTOCOL_F_REPLY_ACK > > -- > > 2.48.1 > >