aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2016-02-03 00:46:40 -0500
committerMichael S. Tsirkin <mst@redhat.com>2016-03-02 10:01:59 -0500
commit78fe39872378b0bef00a91181f1947acb8a08500 (patch)
tree9d6e181e2614abce3f465cfd04745ea9b1e2744f /drivers/virtio
parent7a5589b240b405d55b2b395554082ec284f414bb (diff)
vring: Use the DMA API on Xen
Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_ring.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index e46d08107a50..5c802d47892c 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -25,6 +25,7 @@
25#include <linux/hrtimer.h> 25#include <linux/hrtimer.h>
26#include <linux/kmemleak.h> 26#include <linux/kmemleak.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <xen/xen.h>
28 29
29#ifdef DEBUG 30#ifdef DEBUG
30/* For development, we want to crash whenever the ring is screwed. */ 31/* For development, we want to crash whenever the ring is screwed. */
@@ -136,6 +137,17 @@ struct vring_virtqueue {
136 137
137static bool vring_use_dma_api(struct virtio_device *vdev) 138static bool vring_use_dma_api(struct virtio_device *vdev)
138{ 139{
140 /*
141 * In theory, it's possible to have a buggy QEMU-supposed
142 * emulated Q35 IOMMU and Xen enabled at the same time. On
143 * such a configuration, virtio has never worked and will
144 * not work without an even larger kludge. Instead, enable
145 * the DMA API if we're a Xen guest, which at least allows
146 * all of the sensible Xen configurations to work correctly.
147 */
148 if (xen_domain())
149 return true;
150
139 return false; 151 return false;
140} 152}
141 153