From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932185AbcBAVZF (ORCPT ); Mon, 1 Feb 2016 16:25:05 -0500 Received: from smtp.citrix.com ([66.165.176.89]:7518 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbcBAVY7 (ORCPT ); Mon, 1 Feb 2016 16:24:59 -0500 X-IronPort-AV: E=Sophos;i="5.22,381,1449532800"; d="scan'208";a="329001975" Date: Mon, 1 Feb 2016 21:24:57 +0000 From: Wei Liu To: "Michael S. Tsirkin" CC: David Vrabel , linux-s390 , , Joerg Roedel , KVM , Stefano Stabellini , Benjamin Herrenschmidt , Sebastian Ott , "linux-kernel@vger.kernel.org" , "Linux Virtualization" , "Christian Borntraeger" , "David S. Miller" , Andy Lutomirski , Paolo Bonzini , Cornelia Huck , , David Woodhouse , Christoph Hellwig , Martin Schwidefsky , Subject: Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen Message-ID: <20160201212457.GA9915@citrix.com> References: <64e979cc139c5e6a9bbfae9f1bc5e6693d91bea9.1454034075.git.luto@kernel.org> <56AB4053.4070007@citrix.com> <20160131220601-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160131220601-mutt-send-email-mst@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 31, 2016 at 10:09:07PM +0200, Michael S. Tsirkin wrote: > On Fri, Jan 29, 2016 at 10:34:59AM +0000, David Vrabel wrote: > > 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 > > I doubt HVM domains can have virtio devices. > Yes, they can. When virtio-pci is used virtio device is just yet another pci device emulated by QEMU. Wei. > -- > MST > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel