Skip to content

Commit d08fda2

Browse files
committed
virtio_input: use virtqueue_add_inbuf_cache_clean for events
The evts array contains 64 small (8-byte) input 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. Previous patch isolated the array in its own cachelines, so the warnings are now spurious. Use virtqueue_add_inbuf_cache_clean() to indicate that the CPU does not write into these cache lines, suppressing these warnings. Message-ID: <4c885b4046323f68cf5cadc7fbfb00216b11dd20.1767601130.git.mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent bd2b617 commit d08fda2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/virtio/virtio_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static void virtinput_queue_evtbuf(struct virtio_input *vi,
3030
struct scatterlist sg[1];
3131

3232
sg_init_one(sg, evtbuf, sizeof(*evtbuf));
33-
virtqueue_add_inbuf(vi->evt, sg, 1, evtbuf, GFP_ATOMIC);
33+
virtqueue_add_inbuf_cache_clean(vi->evt, sg, 1, evtbuf, GFP_ATOMIC);
3434
}
3535

3636
static void virtinput_recv_events(struct virtqueue *vq)

0 commit comments

Comments
 (0)