From: "Michael S. Tsirkin" <mst@redhat.com>
To: Albert Esteve <aesteve@redhat.com>
Cc: qemu-devel@nongnu.org, dbassey@redhat.com,
manos.pitsidianakis@linaro.org, slp@redhat.com,
stefanha@redhat.com, "Fabiano Rosas" <farosas@suse.de>,
jasowang@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
david@redhat.com, hi@alyssa.is, stevensd@chromium.org,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH v11 5/7] vhost_user.rst: Add GET_SHMEM_CONFIG message
Date: Fri, 16 Jan 2026 06:15:04 -0500 [thread overview]
Message-ID: <20260116055716-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CADSE00+24EjXdRMDXXf7tgWLaH2gqeDhL_OeRbmZQ2e8JULPXA@mail.gmail.com>
On Fri, Jan 16, 2026 at 11:20:25AM +0100, Albert Esteve wrote:
> On Tue, Nov 11, 2025 at 10:11 AM Albert Esteve <aesteve@redhat.com> wrote:
> >
> > Add GET_SHMEM_CONFIG vhost-user frontend
> > message to the spec documentation.
> >
> > Reviewed-by: Alyssa Ross <hi@alyssa.is>
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Signed-off-by: Albert Esteve <aesteve@redhat.com>
> > ---
> > docs/interop/vhost-user.rst | 39 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 39 insertions(+)
> >
> > diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> > index 6c1d66d7d3..6a1ecd7f48 100644
> > --- a/docs/interop/vhost-user.rst
> > +++ b/docs/interop/vhost-user.rst
> > @@ -371,6 +371,20 @@ MMAP request
> > - 0: Pages are mapped read-only
> > - 1: Pages are mapped read-write
> >
> > +VIRTIO Shared Memory Region configuration
> > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > +
> > ++-------------+---------+------------+----+--------------+
> > +| num regions | padding | mem size 0 | .. | mem size 255 |
> > ++-------------+---------+------------+----+--------------+
> > +
> > +:num regions: a 32-bit number of regions
> > +
> > +:padding: 32-bit
> > +
> > +:mem size: contains ``num regions`` 64-bit fields representing the size of each
> > + VIRTIO Shared Memory Region
> > +
>
> When implementing this for rust-vmm, the mem size came up a bit
> confusing. In the last patch (7/7) of this series, the implementation
> uses `num regions` as a count for the number of valid regions (thus
> accounting for gaps in the shmem region mapping). Thus, `mem size` has
> this confusing statement saying that it containers `num regions`
> fields. It should say it contains 256 fields (it is only sent once
> during initialization, so no need to save bytes here), with only `num
> regions` that are valid (i.e., greater than 0). Maybe it could even
> discard the `num regions` field, and send only the full array.
> Thoughts?
Let's discuss the exact wording here.
I'm not sure why would we need this padding sending unused fields
though. Waste no, need not?
> As much as I wanted this series merged, this deserves a clarification.
> So I can either send a new version of the series or split the last
> three patches into a different series. Hopefully it only requires one
> more version though.
>
>
> > C structure
> > -----------
> >
> > @@ -397,6 +411,7 @@ In QEMU the vhost-user message is implemented with the following struct:
> > VhostUserShared object;
> > VhostUserTransferDeviceState transfer_state;
> > VhostUserMMap mmap;
> > + VhostUserShMemConfig shmem;
> > };
> > } QEMU_PACKED VhostUserMsg;
> >
> > @@ -1761,6 +1776,30 @@ Front-end message types
> > Using this function requires prior negotiation of the
> > ``VHOST_USER_PROTOCOL_F_DEVICE_STATE`` feature.
> >
> > +``VHOST_USER_GET_SHMEM_CONFIG``
> > + :id: 44
> > + :equivalent ioctl: N/A
> > + :request payload: N/A
> > + :reply payload: ``struct VhostUserShMemConfig``
> > +
> > + When the ``VHOST_USER_PROTOCOL_F_SHMEM`` protocol feature has been
> > + successfully negotiated, this message can be submitted by the front-end
> > + to gather the VIRTIO Shared Memory Region configuration. The back-end will
> > + respond with the number of VIRTIO Shared Memory Regions it requires, and
> > + each shared memory region size in an array. The shared memory IDs are
> > + represented by the array index. The information returned shall comply
> > + with the following rules:
> > +
> > + * The shared information will remain valid and unchanged for the entire
> > + lifetime of the connection.
> > +
> > + * The Shared Memory Region size must be a multiple of the page size
> > + supported by mmap(2).
> > +
> > + * The size may be 0 if the region is unused. This can happen when the
> > + device does not support an optional feature but does support a feature
> > + that uses a higher shmid.
> > +
> > Back-end message types
> > ----------------------
> >
> > --
> > 2.49.0
> >
next prev parent reply other threads:[~2026-01-16 11:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 9:10 [PATCH v11 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests Albert Esteve
2025-11-11 9:10 ` [PATCH v11 1/7] vhost-user: Add VirtIO Shared Memory map request Albert Esteve
2026-02-03 21:20 ` Michael S. Tsirkin
2026-02-03 21:22 ` Michael S. Tsirkin
2026-02-03 21:51 ` Michael S. Tsirkin
2025-11-11 9:10 ` [PATCH v11 2/7] vhost_user.rst: Align VhostUserMsg excerpt members Albert Esteve
2025-11-11 9:10 ` [PATCH v11 3/7] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec Albert Esteve
2026-01-15 12:10 ` Alyssa Ross
2026-01-15 12:45 ` Albert Esteve
2026-01-15 13:13 ` Michael S. Tsirkin
2026-01-15 13:35 ` Alyssa Ross
2025-11-11 9:10 ` [PATCH v11 4/7] vhost_user: Add frontend get_shmem_config command Albert Esteve
2025-11-11 9:10 ` [PATCH v11 5/7] vhost_user.rst: Add GET_SHMEM_CONFIG message Albert Esteve
2026-01-16 10:20 ` Albert Esteve
2026-01-16 10:23 ` Manos Pitsidianakis
2026-01-16 11:15 ` Michael S. Tsirkin [this message]
2026-01-16 13:04 ` Albert Esteve
2026-01-19 11:34 ` Albert Esteve
2025-11-11 9:10 ` [PATCH v11 6/7] qmp: add shmem feature map Albert Esteve
2025-11-11 9:10 ` [PATCH v11 7/7] vhost-user-device: Add shared memory BAR Albert Esteve
2026-02-03 21:46 ` Michael S. Tsirkin
2026-02-04 7:46 ` Albert Esteve
2025-12-02 19:50 ` [PATCH v11 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests Michael S. Tsirkin
2025-12-10 7:59 ` Albert Esteve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260116055716-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=aesteve@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=david@redhat.com \
--cc=dbassey@redhat.com \
--cc=farosas@suse.de \
--cc=hi@alyssa.is \
--cc=jasowang@redhat.com \
--cc=lvivier@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=slp@redhat.com \
--cc=stefanha@redhat.com \
--cc=stevensd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.