Skip to content

fix DMA aligment issues around virtio

Michael S. Tsirkin kvm linux-crypto linux-doc linux-gpio linux-iommu linux-scsi lkml netdev virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest15 patches 26 repliesIn review
  2. v1 RFC13 patches 16 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15dma-mapping: add __dma_from_device_group_begin()/end()include/linux/dma-mapping.h+13 -02 replies
2/15docs: dma-api: document __dma_from_device_group_begin()/end()Documentation/core-api/dma-api-howto.rst+52 -02 replies
3/15dma-mapping: add DMA_ATTR_CPU_CACHE_CLEANinclude/linux/dma-mapping.h kernel/dma/debug.c+9 -12 replies
4/15docs: dma-api: document DMA_ATTR_CPU_CACHE_CLEANDocumentation/core-api/dma-attributes.rst+9 -02 replies
5/15dma-debug: track cache clean flag in entrieskernel/dma/debug.c+22 -53 replies
6/15virtio: add virtqueue_add_inbuf_cache_clean APIdrivers/virtio/virtio_ring.c include/linux/virtio.h+65 -230 replies
7/15vsock/virtio: fix DMA alignment for event_listnet/vmw_vsock/virtio_transport.c+3 -13 replies
8/15vsock/virtio: use virtqueue_add_inbuf_cache_clean for eventsnet/vmw_vsock/virtio_transport.c+1 -11 reply
9/15virtio_input: fix DMA alignment for evtsdrivers/virtio/virtio_input.c+3 -00 replies
10/15virtio_scsi: fix DMA cacheline issues for eventsdrivers/scsi/virtio_scsi.c+12 -54 replies
11/15virtio-rng: fix DMA alignment for data bufferdrivers/char/hw_random/virtio-rng.c+3 -00 replies
12/15virtio_input: use virtqueue_add_inbuf_cache_clean for eventsdrivers/virtio/virtio_input.c+1 -10 replies
13/15vsock/virtio: reorder fields to reduce paddingnet/vmw_vsock/virtio_transport.c+5 -35 replies
14/15gpio: virtio: fix DMA alignmentdrivers/gpio/gpio-virtio.c+10 -41 reply
15/15gpio: virtio: reorder fields to reduce struct paddingdrivers/gpio/gpio-virtio.c+2 -13 replies

Reviews trailers per patch

10 of 15 patches have a Reviewed-by or Acked-by.

PatchViresh KumarPetr TesarikBartosz GolaszewskiMarek SzyprowskiStefan HajnocziStefano Garzarella
1/15R-b A-b
2/15R-b A-b
3/15R-b A-b
4/15R-b A-b
5/15R-b
6/15
7/15A-b
8/15A-b
9/15
10/15R-b
11/15
12/15
13/15
14/15A-b A-b
15/15A-b A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/15] fix DMA aligment issues around virtio

Cong Wang reported dma debug warnings with virtio-vsock and proposed a patch, see:

https://lore.kernel.org/all/[email protected]/

however, the issue is more widespread.
This is an attempt to fix it systematically.
Note: i2c and gio might also be affected, I am still looking into it. Help from maintainers welcome.

Lightly tested. Cursor/claude used liberally, mostly for refactoring/API updates/English.

DMA maintainers, could you please confirm the DMA core changes are ok with you?

Thanks!

Michael S. Tsirkin (15):
dma-mapping: add __dma_from_device_group_begin()/end()
docs: dma-api: document __dma_from_device_group_begin()/end()
dma-mapping: add DMA_ATTR_CPU_CACHE_CLEAN
docs: dma-api: document DMA_ATTR_CPU_CACHE_CLEAN
dma-debug: track cache clean flag in entries
virtio: add virtqueue_add_inbuf_cache_clean API vsock/virtio: fix DMA alignment for event_list vsock/virtio: use virtqueue_add_inbuf_cache_clean for events
virtio_input: fix DMA alignment for evts
virtio_scsi: fix DMA cacheline issues for events
virtio-rng: fix DMA alignment for data buffer
virtio_input: use virtqueue_add_inbuf_cache_clean for events vsock/virtio: reorder fields to reduce padding
gpio: virtio: fix DMA alignment
gpio: virtio: reorder fields to reduce struct padding

 Documentation/core-api/dma-api-howto.rst  | 52 ++++++++++++++
 Documentation/core-api/dma-attributes.rst |  9 +++
 drivers/char/hw_random/virtio-rng.c       |  3 +
 drivers/gpio/gpio-virtio.c                | 15 ++--
 drivers/scsi/virtio_scsi.c                | 17 +++--
 drivers/virtio/virtio_input.c             |  5 +-
 drivers/virtio/virtio_ring.c              | 83 ++++++++++++++++-------
 include/linux/dma-mapping.h               | 20 ++++++
 include/linux/virtio.h                    |  5 ++
 kernel/dma/debug.c                        | 28 ++++++--
 net/vmw_vsock/virtio_transport.c          |  8 ++-
 11 files changed, 205 insertions(+), 40 deletions(-)
Signature · 1 line
MST