Commit 78fe3987 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Michael S. Tsirkin

vring: Use the DMA API on Xen

Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: default avatarWei Liu <wei.liu2@citrix.com>
parent 7a5589b2
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
#include <linux/kmemleak.h> #include <linux/kmemleak.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <xen/xen.h>
#ifdef DEBUG #ifdef DEBUG
/* For development, we want to crash whenever the ring is screwed. */ /* For development, we want to crash whenever the ring is screwed. */
...@@ -136,6 +137,17 @@ struct vring_virtqueue { ...@@ -136,6 +137,17 @@ struct vring_virtqueue {
static bool vring_use_dma_api(struct virtio_device *vdev) static bool vring_use_dma_api(struct virtio_device *vdev)
{ {
/*
* In theory, it's possible to have a buggy QEMU-supposed
* emulated Q35 IOMMU and Xen enabled at the same time. On
* such a configuration, virtio has never worked and will
* not work without an even larger kludge. Instead, enable
* the DMA API if we're a Xen guest, which at least allows
* all of the sensible Xen configurations to work correctly.
*/
if (xen_domain())
return true;
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment