lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrU4p5qz_3aq+Xrx7P2m0Ce0yWMczzjngjEp8OzL1yvX6Q@mail.gmail.com>
Date:	Sun, 31 Jan 2016 12:13:58 -0800
From:	Andy Lutomirski <luto@...capital.net>
To:	"Michael S. Tsirkin" <mst@...hat.com>
Cc:	David Vrabel <david.vrabel@...rix.com>,
	Andy Lutomirski <luto@...nel.org>,
	Cornelia Huck <cornelia.huck@...ibm.com>,
	Joerg Roedel <jroedel@...e.de>, KVM <kvm@...r.kernel.org>,
	linux-s390 <linux-s390@...r.kernel.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	Sebastian Ott <sebott@...ux.vnet.ibm.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@....de>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
	sparclinux@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
	Linux Virtualization <virtualization@...ts.linux-foundation.org>,
	David Woodhouse <dwmw2@...radead.org>,
	"David S. Miller" <davem@...emloft.net>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [Xen-devel] [PATCH v5 09/10] vring: Use the DMA API on Xen

On Sun, Jan 31, 2016 at 12:09 PM, Michael S. Tsirkin <mst@...hat.com> 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 <luto@...nel.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 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.
>

They certainly can under nested virt (L0 provides virtio device, L1 is
Xen, and L2 is Linux).  Of course, this won't work given the current
QEMU situation unless Xen can pass things through to dom0 without an
IOMMU, which seems plausible to me.

But yes, xen_domain() sounds right to me.  I just failed to find that
function when I wrote this patch.

Michael, if you like the rest of the series, I'd be okay if you
changed this patch to use xen_domain() when you apply it.  If I send a
v2, I'll fix it up.

--Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ