Skip to content

Commit db191ba

Browse files
committed
vsock/virtio: use virtqueue_add_inbuf_cache_clean for events
The event_list array contains 8 small (4-byte) events that share cachelines with each other. When CONFIG_DMA_API_DEBUG is enabled, this can trigger warnings about overlapping DMA mappings within the same cacheline. The previous patch isolated event_list in its own cache lines so the warnings are spurious. Use virtqueue_add_inbuf_cache_clean() to indicate that the CPU does not write into these fields, suppressing the warnings. Reported-by: Cong Wang <xiyou.wangcong@gmail.com> Message-ID: <4b5bf63a7ebb782d87f643466b3669df567c9fe1.1767601130.git.mst@redhat.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 63dfad0 commit db191ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/vmw_vsock/virtio_transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int virtio_vsock_event_fill_one(struct virtio_vsock *vsock,
393393

394394
sg_init_one(&sg, event, sizeof(*event));
395395

396-
return virtqueue_add_inbuf(vq, &sg, 1, event, GFP_KERNEL);
396+
return virtqueue_add_inbuf_cache_clean(vq, &sg, 1, event, GFP_KERNEL);
397397
}
398398

399399
/* event_lock must be held */

0 commit comments

Comments
 (0)