Thread (2 messages) 2 messages, 2 authors, 2024-06-06

Re: [PATCH vhost v13 04/12] virtio_ring: support add premapped buf

From: Alexander Potapenko <glider@google.com>
Date: 2024-06-06 09:49:50
Also in: bpf, virtualization
Subsystem: the rest, virtio core · Maintainers: Linus Torvalds, "Michael S. Tsirkin", Jason Wang

Possibly related (same subject, not in this thread)

On Thu, Jun 6, 2024 at 10:27 AM Xuan Zhuo [off-list ref] wrote:
On Thu, 6 Jun 2024 10:20:21 +0200, Alexander Potapenko [off-list ref] wrote:
quoted
quoted
Could you try this?
Hi Xuan,

What kernel revision does this patch apply to? I tried it against
v6.10-rc2, and only the first hunk applied.
However this seems to fix the problem, at least the kernel boots without
warnings now.

Sorry, I have some changes locally.

If the hunk #1 is applied, then it is ok.

Do you think we need more test? Or I post an new patch directly.
I think we're good to go (just double-checked that). Assuming you're
sending the following patch:
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 2a972752ff1bc..9d3a9942c8c82 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -3121,8 +3121,10 @@ dma_addr_t
virtqueue_dma_map_single_attrs(struct virtqueue *_vq, void *ptr,
 {
        struct vring_virtqueue *vq = to_vvq(_vq);

-       if (!vq->use_dma_api)
+       if (!vq->use_dma_api) {
+               kmsan_handle_dma(virt_to_page(ptr),
offset_in_page(ptr), size, dir);
                return (dma_addr_t)virt_to_phys(ptr);
+       }

        return dma_map_single_attrs(vring_dma_dev(vq), ptr, size, dir, attrs);
 }

, feel free to add:

Tested-by: Alexander Potapenko <glider@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help