History

vring: Use the DMA API on Xen

Andy Lutomirski committed 10 years ago

Commit 78fe3981 parent 7a5589b1 file · +12 −0Browse files

Unified · Split

drivers/virtio/virtio_ring.c+12−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/hrtimer.h>
2626 #include <linux/kmemleak.h>
2727 #include <linux/dma-mapping.h>
28+#include <xen/xen.h>
2829
2930 #ifdef DEBUG
3031 /* For development, we want to crash whenever the ring is screwed. */
@@ -136,6 +137,17 @@ struct vring_virtqueue { · 105 unmodified lines
136137
137138 static bool vring_use_dma_api(struct virtio_device *vdev)
138139 {
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+
139151 return false;
140152 }
141153

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t