Skip to content

vfio-user: Implement sparse mmap capability for Server#132

Merged
likebreath merged 2 commits intorust-vmm:mainfrom
sboeuf:server_sparse_mmap
Mar 2, 2026
Merged

vfio-user: Implement sparse mmap capability for Server#132
likebreath merged 2 commits intorust-vmm:mainfrom
sboeuf:server_sparse_mmap

Conversation

@sboeuf
Copy link
Collaborator

@sboeuf sboeuf commented Feb 27, 2026

The vfio-user client already supports the sparse mmap capability but
this was missing from the server implementation.

Adding this feature so that a vfio-user server relying on this crate can
use the sparse mmap capability to define subregions which must be memory
mapped within standard PCI regions.

As stated in the vfio-user spec here
https://www.qemu.org/docs/master/interop/vfio-user.html#sparse-regions
in the context of an NVMe emulated device, having the doorbell region
memory mapped allows for great performance since the backend can poll
the doorbells directly and catch any new entry in the submission queues.

Manage the server socket better by removing the socket path when the
server is dropped. Also, remove a possible leftover socket path when
starting the server.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
@sboeuf sboeuf force-pushed the server_sparse_mmap branch 3 times, most recently from 6f3d6a5 to 6cc15bf Compare February 27, 2026 14:23
Copy link
Collaborator

@likebreath likebreath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one nit below.

The vfio-user client already supports the sparse mmap capability but
this was missing from the server implementation.

Adding this feature so that a vfio-user server relying on this crate can
use the sparse mmap capability to define subregions which must be memory
mapped within standard PCI regions.

As stated in the vfio-user spec here
https://www.qemu.org/docs/master/interop/vfio-user.html#sparse-regions
in the context of an NVMe emulated device, having the doorbell region
memory mapped allows for great performance since the backend can poll
the doorbells directly and catch any new entry in the submission queues.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
@sboeuf sboeuf force-pushed the server_sparse_mmap branch from 6cc15bf to 845006b Compare March 2, 2026 08:09
@sboeuf sboeuf requested a review from likebreath March 2, 2026 15:15
@likebreath likebreath merged commit bc5b0d0 into rust-vmm:main Mar 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants