netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/15] fix DMA aligment issues around virtio
@ 2026-01-05  8:22 Michael S. Tsirkin
  2026-01-05  8:22 ` [PATCH v2 01/15] dma-mapping: add __dma_from_device_group_begin()/end() Michael S. Tsirkin
                   ` (14 more replies)
  0 siblings, 15 replies; 42+ messages in thread
From: Michael S. Tsirkin @ 2026-01-05  8:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Cong Wang, Jonathan Corbet, Olivia Mackall, Herbert Xu,
	Jason Wang, Paolo Bonzini, Stefan Hajnoczi, Eugenio Pérez,
	James E.J. Bottomley, Martin K. Petersen, Gerd Hoffmann,
	Xuan Zhuo, Marek Szyprowski, Robin Murphy, Stefano Garzarella,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Petr Tesarik, Leon Romanovsky, Jason Gunthorpe,
	Bartosz Golaszewski, linux-doc, linux-crypto, virtualization,
	linux-scsi, iommu, kvm, netdev


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

https://lore.kernel.org/all/20251228015451.1253271-1-xiyou.wangcong@gmail.com/

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(-)

-- 
MST


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2026-01-08 14:45 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05  8:22 [PATCH v2 00/15] fix DMA aligment issues around virtio Michael S. Tsirkin
2026-01-05  8:22 ` [PATCH v2 01/15] dma-mapping: add __dma_from_device_group_begin()/end() Michael S. Tsirkin
2026-01-05  9:40   ` Petr Tesarik
2026-01-05 18:27   ` Marek Szyprowski
2026-01-05  8:22 ` [PATCH v2 02/15] docs: dma-api: document __dma_from_device_group_begin()/end() Michael S. Tsirkin
2026-01-05  9:48   ` Petr Tesarik
2026-01-05 18:28   ` Marek Szyprowski
2026-01-05  8:23 ` [PATCH v2 03/15] dma-mapping: add DMA_ATTR_CPU_CACHE_CLEAN Michael S. Tsirkin
2026-01-05  9:50   ` Petr Tesarik
2026-01-08 13:57   ` Marek Szyprowski
2026-01-05  8:23 ` [PATCH v2 04/15] docs: dma-api: document DMA_ATTR_CPU_CACHE_CLEAN Michael S. Tsirkin
2026-01-05  9:51   ` Petr Tesarik
2026-01-08 13:59   ` Marek Szyprowski
2026-01-05  8:23 ` [PATCH v2 05/15] dma-debug: track cache clean flag in entries Michael S. Tsirkin
2026-01-05  9:54   ` Petr Tesarik
2026-01-05 12:37     ` Michael S. Tsirkin
2026-01-05 13:40       ` Petr Tesarik
2026-01-05  8:23 ` [PATCH v2 06/15] virtio: add virtqueue_add_inbuf_cache_clean API Michael S. Tsirkin
2026-01-05  8:23 ` [PATCH v2 07/15] vsock/virtio: fix DMA alignment for event_list Michael S. Tsirkin
2026-01-08 14:04   ` Stefano Garzarella
2026-01-08 14:07     ` Michael S. Tsirkin
2026-01-08 14:18       ` Stefano Garzarella
2026-01-05  8:23 ` [PATCH v2 08/15] vsock/virtio: use virtqueue_add_inbuf_cache_clean for events Michael S. Tsirkin
2026-01-08 14:08   ` Stefano Garzarella
2026-01-05  8:23 ` [PATCH v2 09/15] virtio_input: fix DMA alignment for evts Michael S. Tsirkin
2026-01-05  8:23 ` [PATCH v2 10/15] virtio_scsi: fix DMA cacheline issues for events Michael S. Tsirkin
2026-01-05 18:19   ` Stefan Hajnoczi
2026-01-06 14:50     ` Michael S. Tsirkin
2026-01-07 16:29       ` Stefan Hajnoczi
2026-01-06 14:51     ` Michael S. Tsirkin
2026-01-05  8:23 ` [PATCH v2 11/15] virtio-rng: fix DMA alignment for data buffer Michael S. Tsirkin
2026-01-05  8:23 ` [PATCH v2 12/15] virtio_input: use virtqueue_add_inbuf_cache_clean for events Michael S. Tsirkin
2026-01-05  8:23 ` [PATCH v2 13/15] vsock/virtio: reorder fields to reduce padding Michael S. Tsirkin
2026-01-08 14:11   ` Stefano Garzarella
2026-01-08 14:17     ` Michael S. Tsirkin
2026-01-08 14:27       ` Stefano Garzarella
2026-01-08 14:32         ` Michael S. Tsirkin
2026-01-08 14:45           ` Stefano Garzarella
2026-01-05  8:23 ` [PATCH v2 14/15] gpio: virtio: fix DMA alignment Michael S. Tsirkin
2026-01-05  9:48   ` Bartosz Golaszewski
2026-01-05  8:23 ` [PATCH v2 15/15] gpio: virtio: reorder fields to reduce struct padding Michael S. Tsirkin
2026-01-05  9:49   ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).