From: Albert Esteve <aesteve@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
slp@redhat.com, hi@alyssa.is, mst@redhat.com, david@redhat.com,
jasowang@redhat.com, stefanha@redhat.com,
"Stefano Garzarella" <sgarzare@redhat.com>,
stevensd@chromium.org, "Albert Esteve" <aesteve@redhat.com>
Subject: [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests
Date: Thu, 12 Sep 2024 16:53:30 +0200 [thread overview]
Message-ID: <20240912145335.129447-1-aesteve@redhat.com> (raw)
Hi all,
v2->v3:
- Add track for mapped memory in VIRTIO
Shared memory regions, so that boundaries
can be verified when a request for
new mmap is received
- Use address_space_read/write() for
MEM_READ/_WRITE handling methods.
- Improve/fix support for flexible
array members for MEM_READ/_WRITE requests.
- Split documentation into a separate patch.
- Various small fixes from previous review.
The usecase for this patch is, e.g., to support
vhost-user-gpu RESOURCE_BLOB operations,
or DAX Window request for virtio-fs. In
general, any operation where a backend
need to request the frontend to mmap an
fd into a VIRTIO Shared Memory Region,
so that the guest can then access it.
After receiving the SHMEM_MAP/UNMAP request,
the frontend will perform the mmap with the
instructed parameters (i.e., shmid, shm_offset,
fd_offset, fd, lenght).
As there are already a couple devices
that could benefit of such a feature,
and more could require it in the future,
the goal is to make the implementation
generic.
To that end, the VIRTIO Shared Memory
Region list is declared in the `VirtIODevice`
struct.
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).
Finally, MEM_READ/WRITE backend requests are
added to deal with a potential issue when having
any backend sharing a descriptor that references
a mapping to another backend. The first
backend will not be able to see these
mappings. So these requests are a fallback
for vhost-user memory translation fails.
Albert Esteve (5):
vhost-user: Add VIRTIO Shared Memory map request
virtio: Track shared memory mappings
vhost_user: Add frontend command for shmem config
vhost-user-dev: Add cache BAR
vhost_user: Add MEM_READ/WRITE backend requests
hw/virtio/vhost-user-base.c | 37 ++-
hw/virtio/vhost-user-device-pci.c | 39 +++-
hw/virtio/vhost-user.c | 273 ++++++++++++++++++++--
hw/virtio/virtio.c | 59 +++++
include/hw/virtio/vhost-backend.h | 6 +
include/hw/virtio/vhost-user.h | 1 +
include/hw/virtio/virtio.h | 26 +++
subprojects/libvhost-user/libvhost-user.c | 144 ++++++++++++
subprojects/libvhost-user/libvhost-user.h | 90 +++++++
9 files changed, 648 insertions(+), 27 deletions(-)
--
2.45.2
next reply other threads:[~2024-09-12 14:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 14:53 Albert Esteve [this message]
2024-09-12 14:53 ` [PATCH v3 1/5] vhost-user: Add VIRTIO Shared Memory map request Albert Esteve
2024-09-16 17:21 ` Stefan Hajnoczi
2024-11-25 9:55 ` Albert Esteve
2024-09-17 10:07 ` David Hildenbrand
2024-11-25 8:28 ` Albert Esteve
2024-11-27 10:50 ` David Hildenbrand
2024-11-27 12:10 ` David Hildenbrand
2024-11-27 12:17 ` David Hildenbrand
2024-11-27 12:31 ` Albert Esteve
2024-11-27 12:40 ` David Hildenbrand
2024-11-27 12:55 ` Albert Esteve
2024-09-12 14:53 ` [PATCH v3 2/5] virtio: Track shared memory mappings Albert Esteve
2024-09-16 17:27 ` Stefan Hajnoczi
2024-09-12 14:53 ` [PATCH v3 3/5] vhost_user: Add frontend command for shmem config Albert Esteve
2024-09-17 7:48 ` Stefan Hajnoczi
2024-09-17 7:50 ` Stefan Hajnoczi
2024-09-12 14:53 ` [PATCH v3 4/5] vhost-user-dev: Add cache BAR Albert Esteve
2024-09-17 8:27 ` Stefan Hajnoczi
2024-11-25 16:16 ` Albert Esteve
2024-11-26 7:55 ` Albert Esteve
2024-11-26 12:51 ` Albert Esteve
2024-09-17 8:32 ` Stefan Hajnoczi
2024-09-17 8:36 ` Stefan Hajnoczi
2024-09-12 14:53 ` [PATCH v3 5/5] vhost_user: Add MEM_READ/WRITE backend requests Albert Esteve
2024-09-12 14:59 ` [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests Albert Esteve
2024-09-16 17:57 ` Stefan Hajnoczi
2024-09-17 7:05 ` Albert Esteve
2024-09-17 7:43 ` 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=20240912145335.129447-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).