Skip to content

virtio: support devices that own their virtqueue memory - #1155

Open
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1142966=>linus-master
Open

virtio: support devices that own their virtqueue memory#1155
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1142966=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown

Pull request for series with
subject: virtio: support devices that own their virtqueue memory
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=1148090

@blktests-ci

blktests-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Author

Upstream branch: 8d3ae59
series: https://patchwork.kernel.org/project/linux-block/list/?series=1148090
version: 2

Let a modern virtio-pci device place its virtqueues and the buffers they
reference in a Device Memory Buffer of its own: accept VIRTIO_F_DMB from
vp_transport_features(), and implement the get_dmb_shm_id config op on
top of vp_modern_get_dmb_shm_id(). get_dmb_shm_id reports the shared
memory id of the region that holds the buffer.

Take the offer only for a dmb_mem_type of VIRTIO_DMB_MEM_TYPE_COHERENT,
the memory type that says a write by either side becomes visible to the
other with no cache maintenance by the driver. The driver uses plain
loads and stores on the region, so no other type will do. The field is
valid from the moment the device offers the feature, so a type the driver
does not support leaves the device driven as an ordinary one. The shmid
is not readable that early, so a region we fail to locate after the
accept fails virtio_features_ok() and probe sets the FAILED status bit.

Refuse a device whose common configuration is too short to hold
dmb_mem_type, which would put that read outside what vp_modern_probe()
mapped. The accept path measures the structure itself, because
vp_check_common_size() runs on the features the driver has already
accepted and so cannot cover a read that precedes it.

Two more things gate the accept. CONFIG_VIRTIO_DMB, so that a device
offering the feature to a kernel built without it is driven as an ordinary
device. And VIRTIO_F_VERSION_1, because virtio_features_ok() returns early
without it, which would leave the feature negotiated and the region never
built; this transport refuses such a device anyway.

Link: https://lore.kernel.org/virtio-comment/20260818060255.6853-1-graf@amazon.com/
Assisted-by: Kiro:claude-opus-5 checkpatch sparse
Signed-off-by: Alexander Graf <graf@amazon.com>
@blktests-ci

blktests-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Author

Upstream branch: bd5f485
series: https://patchwork.kernel.org/project/linux-block/list/?series=1148090
version: 2

@blktests-ci
blktests-ci Bot force-pushed the series/1142966=>linus-master branch from 269a967 to 669f9f8 Compare August 19, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant