From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754684AbcA2KfJ (ORCPT ); Fri, 29 Jan 2016 05:35:09 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:25144 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754512AbcA2KfE (ORCPT ); Fri, 29 Jan 2016 05:35:04 -0500 X-IronPort-AV: E=Sophos;i="5.22,363,1449532800"; d="scan'208";a="334819025" Subject: Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen To: Andy Lutomirski , "Michael S. Tsirkin" References: <64e979cc139c5e6a9bbfae9f1bc5e6693d91bea9.1454034075.git.luto@kernel.org> CC: Cornelia Huck , Joerg Roedel , KVM , linux-s390 , "Benjamin Herrenschmidt" , Stefano Stabellini , Sebastian Ott , "linux-kernel@vger.kernel.org" , Christoph Hellwig , "Christian Borntraeger" , David Vrabel , , , Paolo Bonzini , Linux Virtualization , David Woodhouse , "David S. Miller" , "Martin Schwidefsky" From: David Vrabel X-Enigmail-Draft-Status: N1110 Message-ID: <56AB4053.4070007@citrix.com> Date: Fri, 29 Jan 2016 10:34:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <64e979cc139c5e6a9bbfae9f1bc5e6693d91bea9.1454034075.git.luto@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/01/16 02:31, Andy Lutomirski wrote: > Signed-off-by: Andy Lutomirski > --- > 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 c169c6444637..305c05cc249a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -47,6 +47,18 @@ > > static bool vring_use_dma_api(void) > { > +#if defined(CONFIG_X86) && defined(CONFIG_XEN) > + /* > + * 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. > + */ > + return static_cpu_has(X86_FEATURE_XENPV); You want: if (xen_domain()) return true; Without the #if so we use the DMA API for all types of Xen guest on all architectures. David From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen Date: Fri, 29 Jan 2016 10:34:59 +0000 Message-ID: <56AB4053.4070007@citrix.com> References: <64e979cc139c5e6a9bbfae9f1bc5e6693d91bea9.1454034075.git.luto@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <64e979cc139c5e6a9bbfae9f1bc5e6693d91bea9.1454034075.git.luto@kernel.org> Sender: sparclinux-owner@vger.kernel.org List-Archive: List-Post: To: Andy Lutomirski , "Michael S. Tsirkin" Cc: Cornelia Huck , Joerg Roedel , KVM , linux-s390 , Benjamin Herrenschmidt , Stefano Stabellini , Sebastian Ott , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Christian Borntraeger , David Vrabel , xen-devel@lists.xenproject.org, sparclinux@vger.kernel.org, Paolo Bonzini , Linux Virtualization , David Woodhouse , "David S. Miller" , Martin Schwidefsky List-ID: On 29/01/16 02:31, Andy Lutomirski wrote: > Signed-off-by: Andy Lutomirski > --- > 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 c169c6444637..305c05cc249a 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -47,6 +47,18 @@ > > static bool vring_use_dma_api(void) > { > +#if defined(CONFIG_X86) && defined(CONFIG_XEN) > + /* > + * 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. > + */ > + return static_cpu_has(X86_FEATURE_XENPV); You want: if (xen_domain()) return true; Without the #if so we use the DMA API for all types of Xen guest on all architectures. David