]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_mmio: Set DMA masks appropriately
authorRobin Murphy <robin.murphy@arm.com>
Tue, 10 Jan 2017 17:51:17 +0000 (17:51 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 24 Jan 2017 22:33:10 +0000 (00:33 +0200)
commit739156af91611cf19546f7b42c18567682843f92
tree16604be2ced1416e3a2ec61225e4bf484cce0a72
parentd0ace14264445d60d7dbe2b44307f7e9506e2b35
virtio_mmio: Set DMA masks appropriately

Once DMA API usage is enabled, it becomes apparent that virtio-mmio is
inadvertently relying on the default 32-bit DMA mask, which leads to
problems like rapidly exhausting SWIOTLB bounce buffers.

Ensure that we set the appropriate 64-bit DMA mask whenever possible,
with the coherent mask suitably limited for the legacy vring as per
32f08e1fe969 ("virtio_pci: Limit DMA mask to 44 bits for legacy virtio
devices").

Cc: Andy Lutomirski <luto@kernel.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Fixes: 229c3d9b39b7 ("virtio_mmio: Use the DMA API if enabled")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mmio.c