Skip to content

Commit 0d5415b

Browse files
committed
Revert "vring: Force use of DMA API for ARM-based systems with legacy devices"
This reverts commit c707061. This has been shown to regress on some ARM systems: by forcing on DMA API usage for ARM systems, we have inadvertently kicked open a hornets' nest in terms of cache-coherency. Namely that unless the virtio device is explicitly described as capable of coherent DMA by firmware, the DMA APIs on ARM and other DT-based platforms will assume it is non-coherent. This turns out to cause a big problem for the likes of QEMU and kvmtool, which generate virtio-mmio devices in their guest DTs but neglect to add the often-overlooked "dma-coherent" property; as a result, we end up with the guest making non-cacheable accesses to the vring, the host doing so cacheably, both talking past each other and things going horribly wrong. We are working on a safer work-around. Fixes: c707061 ("vring: Force use of DMA API for ARM-based systems with legacy devices") Reported-by: Robin Murphy <[email protected]> Cc: <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Marc Zyngier <[email protected]>
1 parent 566cf87 commit 0d5415b

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ static bool vring_use_dma_api(struct virtio_device *vdev)
159159
if (xen_domain())
160160
return true;
161161

162-
/*
163-
* On ARM-based machines, the DMA ops will do the right thing,
164-
* so always use them with legacy devices.
165-
*/
166-
if (IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64))
167-
return !virtio_has_feature(vdev, VIRTIO_F_VERSION_1);
168-
169162
return false;
170163
}
171164

0 commit comments

Comments
 (0)