virtio: support devices that own their virtqueue memory - #1155
Open
blktests-ci[bot] wants to merge 1 commit into
Open
virtio: support devices that own their virtqueue memory#1155blktests-ci[bot] wants to merge 1 commit into
blktests-ci[bot] wants to merge 1 commit into
Conversation
Author
|
Upstream branch: 8d3ae59 |
blktests-ci
Bot
force-pushed
the
linus-master_base
branch
from
August 19, 2026 05:25
60442a3 to
3df366e
Compare
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>
Author
|
Upstream branch: bd5f485 |
blktests-ci
Bot
force-pushed
the
series/1142966=>linus-master
branch
from
August 19, 2026 05:36
269a967 to
669f9f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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