[PATCH v5 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests

Albert Esteve posted 7 patches 5 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250609144729.884027-1-aesteve@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
There is a newer version of this series
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(-)
[PATCH v5 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests
Posted by Albert Esteve 5 months, 1 week ago
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