From: Stefan Hajnoczi <stefanha@redhat.com>
To: Albert Esteve <aesteve@redhat.com>
Cc: qemu-devel@nongnu.org, stevensd@chromium.org, dbassey@redhat.com,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
mst@redhat.com, slp@redhat.com, hi@alyssa.is,
"Fabiano Rosas" <farosas@suse.de>,
"Stefano Garzarella" <sgarzare@redhat.com>,
jasowang@redhat.com, david@redhat.com,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v8 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests
Date: Mon, 29 Sep 2025 15:15:42 -0400 [thread overview]
Message-ID: <20250929191542.GI81824@fedora> (raw)
In-Reply-To: <CADSE00K1zU9EeHYRCXie=i=jz55YLzExXdJ5_Ng6sH2w0fySVQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3150 bytes --]
On Fri, Sep 26, 2025 at 10:28:07AM +0200, Albert Esteve wrote:
> On Wed, Sep 10, 2025 at 1:54 PM Albert Esteve <aesteve@redhat.com> wrote:
> >
> > Hi all,
> >
> > v7->v8
> > - Unified VhostUserShmemObject and VirtioSharedMemoryMapping
> > - Refined shmem_obj lifecycle by transferring ownership
> > - Other small improvements
> > v6->v7
> > - Fixed vhost_user_shmem_object_new to use
> > memory_region_init_ram_from_fd as before
> > v5->v6
> > - Added intermediate QOM object to manage shared MemoryRegion lifecycle
> > with reference counting, and automatic cleanup
> > - Resolved BAR conflict, change from 2 to 3 to avoid conflict with
> > `modern-pio-notify=on`
> > - Added SHMEM_CONFIG validation in vhost-user-test
> > - Changed VirtSharedMemory -> VirtioSharedMemory
> > - Changed MappedMemoryRegion -> VirtioSharedMemoryMapping
> > - Changed from heap-allocated MemoryRegion *mr to embedded MemoryRegion
> > mr in VirtioSharedMemory structure to eliminate memory leaks and
> > simplify cleanup
> > - Fixed VirtioSharedMemory initialization and cleanup with
> > memory_region_init() and object_unparent()
> > - Other minor fixes, typos, and updates.
> >
> > This patch series implements dynamic fd-backed memory mapping support
> > for vhost-user backends, enabling backends to dynamically request memory
> > mappings and unmappings during runtime through the new
> > VHOST_USER_BACKEND_SHMEM_MAP/UNMAP protocol messages.
> >
> > This feature benefits various VIRTIO devices that require dynamic shared
> > memory management, including virtiofs (for DAX mappings), virtio-gpu
> > (for resource sharing), and the recently standardized virtio-media.
> >
> > The implementation introduces a QOM-based architecture for managing
> > shared memory lifecycle:
> >
> > - VirtioSharedMemoryMapping: an intermediate object that manages
> > individual memory mappings by acting as generic container for regions
> > declared in any vhost-user device type
> > - Dynamic Mapping: backends can request mappings via SHMEM_MAP messages,
> > with the frontend creating MemoryRegions from the provided file
> > descriptors and adding them as subregions
> >
> > When a SHMEM_MAP request is received, the frontend:
> > 1. Creates VirtioSharedMemoryMapping to manage the mapping lifecycle
> > 2. Maps the provided fd with memory_region_init_ram_from_fd()
> > 3. Creates a MemoryRegion backed by the mapped memory
> > 4. Adds it as a subregion of the appropiate VIRTIO Shared Memory Region
> >
> > The QOM reference counting ensures automatic cleanup when mappings are
> > removed or the device is destroyed.
> >
> > This patch also includes:
> > - VHOST_USER_GET_SHMEM_CONFIG: a new frontend request allowing generic
> > vhost-user devices to query shared memory configuration from backends
> > at device initialization, enabling the generic vhost-user-device
> > frontend to work with any backend regardless of specific shared memory
> > requirements.
>
> Small bump to avoid this patch series falling too much.
Sorry for the slow review. I've finished now.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2025-09-29 19:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 11:54 [PATCH v8 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests Albert Esteve
2025-09-10 11:54 ` [PATCH v8 1/7] vhost-user: Add VirtIO Shared Memory map request Albert Esteve
2025-09-29 18:39 ` Stefan Hajnoczi
2025-10-14 13:52 ` Albert Esteve
2025-10-14 15:50 ` Stefan Hajnoczi
2025-10-15 6:51 ` Albert Esteve
2025-09-29 19:15 ` Stefan Hajnoczi
2025-09-10 11:54 ` [PATCH v8 2/7] vhost_user.rst: Align VhostUserMsg excerpt members Albert Esteve
2025-09-10 11:54 ` [PATCH v8 3/7] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec Albert Esteve
2025-09-29 18:48 ` Stefan Hajnoczi
2025-09-10 11:54 ` [PATCH v8 4/7] vhost_user: Add frontend get_shmem_config command Albert Esteve
2025-09-29 18:50 ` Stefan Hajnoczi
2025-09-10 11:54 ` [PATCH v8 5/7] vhost_user.rst: Add GET_SHMEM_CONFIG message Albert Esteve
2025-09-10 11:54 ` [PATCH v8 6/7] qmp: add shmem feature map Albert Esteve
2025-09-10 11:54 ` [PATCH v8 7/7] vhost-user-device: Add shared memory BAR Albert Esteve
2025-09-29 19:00 ` Stefan Hajnoczi
2025-10-13 15:37 ` Albert Esteve
2025-10-14 15:18 ` Stefan Hajnoczi
2025-10-15 6:46 ` Albert Esteve
2025-09-26 8:28 ` [PATCH v8 0/7] vhost-user: Add SHMEM_MAP/UNMAP requests Albert Esteve
2025-09-29 19:15 ` Stefan Hajnoczi [this message]
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=20250929191542.GI81824@fedora \
--to=stefanha@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=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=slp@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).