Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1324927 > unrolled thread

[PATCH v7 9/9] vring: Use the DMA API on Xen

Started byAndy Lutomirski <luto@kernel.org>
First post2016-02-03 06:50 +0100
Last post2016-02-04 18:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v7 9/9] vring: Use the DMA API on Xen Andy Lutomirski <luto@kernel.org> - 2016-02-03 06:50 +0100
    Re: [PATCH v7 9/9] vring: Use the DMA API on Xen David Vrabel <david.vrabel@citrix.com> - 2016-02-03 10:50 +0100
      Re: [PATCH v7 9/9] vring: Use the DMA API on Xen Andy Lutomirski <luto@amacapital.net> - 2016-02-04 18:50 +0100

#1324927 — [PATCH v7 9/9] vring: Use the DMA API on Xen

FromAndy Lutomirski <luto@kernel.org>
Date2016-02-03 06:50 +0100
Subject[PATCH v7 9/9] vring: Use the DMA API on Xen
Message-ID<qXYud-6cO-1@gated-at.bofh.it>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/virtio/virtio_ring.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

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 @@
 #include <linux/hrtimer.h>
 #include <linux/kmemleak.h>
 #include <linux/dma-mapping.h>
+#include <xen/xen.h>
 
 #ifdef DEBUG
 /* For development, we want to crash whenever the ring is screwed. */
@@ -136,6 +137,17 @@ struct vring_virtqueue {
 
 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;
 }
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1325104

FromDavid Vrabel <david.vrabel@citrix.com>
Date2016-02-03 10:50 +0100
Message-ID<qY2ew-ew-35@gated-at.bofh.it>
In reply to#1324927
On 03/02/16 05:46, Andy Lutomirski wrote:
> Signed-off-by: Andy Lutomirski <luto@kernel.org>

You forgot the previous Reviewed-by tags.

David

[toc] | [prev] | [next] | [standalone]


#1327069

FromAndy Lutomirski <luto@amacapital.net>
Date2016-02-04 18:50 +0100
Message-ID<qYwcx-5aH-3@gated-at.bofh.it>
In reply to#1325104
On Wed, Feb 3, 2016 at 1:49 AM, David Vrabel <david.vrabel@citrix.com> wrote:
> On 03/02/16 05:46, Andy Lutomirski wrote:
>> Signed-off-by: Andy Lutomirski <luto@kernel.org>
>
> You forgot the previous Reviewed-by tags.

Whoops.  If I send another version, they'll be there.

>
> David



-- 
Andy Lutomirski
AMA Capital Management, LLC

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web