qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Albert Esteve <aesteve@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, slp@redhat.com, david@redhat.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	jasowang@redhat.com, stevensd@chromium.org, hi@alyssa.is,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Albert Esteve" <aesteve@redhat.com>
Subject: [PATCH v5 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests
Date: Mon,  9 Jun 2025 16:47:22 +0200	[thread overview]
Message-ID: <20250609144729.884027-1-aesteve@redhat.com> (raw)

Hi all,

v4->v5
- Change vdev->shmem_list to QSIMPLEQ type
- Dropped MEM_READ/WRITE messages
- Improved message handling for
  SHMEM_MAP/UNMAP (fix leaks, fix
  response logic, reworked field
  checks, etc.)
- Changed VHOST_USER_FLAG_MAP_* to
  have only read-write flag

The goal of this patch is to support
dynamic fd-backed memory maps initiated
from vhost-user backends.
There are many devices that could already
benefit of this feature, e.g.,
virtiofs, virtio-gpu, or the recently
added to the spec, virtio-media device.

After receiving the SHMEM_MAP/UNMAP request,
the frontend creates the RAMBlock form the
fd and maps it by adding it as a subregion
of the shared memory region container.

The VIRTIO Shared Memory Region list is
declared in the `VirtIODevice` struct
to make it generic.

The message handling code has been tested
with a rust-vmm device, which entails
some level of validation.

This patch also includes:
- SHMEM_CONFIG frontend request that is
specifically meant to allow generic
vhost-user-device frontend to be able to
query VIRTIO Shared Memory settings from the
backend (as this device is generic and agnostic
of the actual backend configuration).

Albert Esteve (7):
  vhost-user: Add VirtIO Shared Memory map request
  vhost_user.rst: Align VhostUserMsg excerpt members
  vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec
  vhost_user: Add frontend get_shmem_config command
  vhost_user.rst: Add GET_SHMEM_CONFIG message
  qmp: add shmem feature map
  vhost-user-devive: Add shmem BAR

 docs/interop/vhost-user.rst               |  98 +++++++++++
 hw/virtio/vhost-user-base.c               |  47 +++++-
 hw/virtio/vhost-user-device-pci.c         |  34 +++-
 hw/virtio/vhost-user.c                    | 193 ++++++++++++++++++++++
 hw/virtio/virtio-qmp.c                    |   3 +
 hw/virtio/virtio.c                        |  97 +++++++++++
 include/hw/virtio/vhost-backend.h         |  10 ++
 include/hw/virtio/vhost-user.h            |   1 +
 include/hw/virtio/virtio.h                |  31 ++++
 subprojects/libvhost-user/libvhost-user.c |  70 ++++++++
 subprojects/libvhost-user/libvhost-user.h |  54 ++++++
 11 files changed, 633 insertions(+), 5 deletions(-)

-- 
2.49.0



             reply	other threads:[~2025-06-09 14:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 14:47 Albert Esteve [this message]
2025-06-09 14:47 ` [PATCH v5 1/7] vhost-user: Add VirtIO Shared Memory map request Albert Esteve
2025-06-10 10:43   ` David Hildenbrand
2025-06-12 16:18   ` Stefan Hajnoczi
     [not found]     ` <CADSE00LrrTNYLKnGqUNSH_HqtPA4n0t6Qq1JA5b1=mUQ2XO0iA@mail.gmail.com>
2025-06-16 15:33       ` Albert Esteve
2025-06-09 14:47 ` [PATCH v5 2/7] vhost_user.rst: Align VhostUserMsg excerpt members Albert Esteve
2025-06-10 10:44   ` David Hildenbrand
2025-06-09 14:47 ` [PATCH v5 3/7] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec Albert Esteve
2025-06-11  6:20   ` Alyssa Ross
2025-06-11  8:53     ` Albert Esteve
2025-06-09 14:47 ` [PATCH v5 4/7] vhost_user: Add frontend get_shmem_config command Albert Esteve
2025-06-24 19:23   ` Stefan Hajnoczi
2025-06-09 14:47 ` [PATCH v5 5/7] vhost_user.rst: Add GET_SHMEM_CONFIG message Albert Esteve
2025-06-09 14:47 ` [PATCH v5 6/7] qmp: add shmem feature map Albert Esteve
2025-06-09 14:47 ` [PATCH v5 7/7] vhost-user-devive: Add shmem BAR Albert Esteve
2025-06-11  6:29   ` Alyssa Ross
2025-06-25 16:47   ` Stefan Hajnoczi

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=20250609144729.884027-1-aesteve@redhat.com \
    --to=aesteve@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=david@redhat.com \
    --cc=hi@alyssa.is \
    --cc=jasowang@redhat.com \
    --cc=mst@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).