[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1446042754.3405.237.camel@infradead.org>
Date: Wed, 28 Oct 2015 23:32:34 +0900
From: David Woodhouse <dwmw2@...radead.org>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Christian Borntraeger <borntraeger@...ibm.com>,
Andy Lutomirski <luto@...nel.org>,
linux-kernel@...r.kernel.org, Joerg Roedel <jroedel@...e.de>,
Cornelia Huck <cornelia.huck@...ibm.com>,
Sebastian Ott <sebott@...ux.vnet.ibm.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Christoph Hellwig <hch@....de>, benh@...nel.crashing.org,
KVM <kvm@...r.kernel.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
linux-s390 <linux-s390@...r.kernel.org>,
virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v3 0/3] virtio DMA API core stuff
On Wed, 2015-10-28 at 16:22 +0200, Michael S. Tsirkin wrote:
> On Wed, Oct 28, 2015 at 11:13:29PM +0900, David Woodhouse wrote:
> > On Wed, 2015-10-28 at 16:05 +0200, Michael S. Tsirkin wrote:
> > >
> > > Short answer - platforms need a way to discover, and express
> > > different
> > > security requirements of different devices.
> >
> > Sure. PLATFORMS need that. Do not let it go anywhere near your
> > device
> > drivers. Including the virtio drivers.
>
> But would there be any users of this outside the virtio subsystem?
> If no, maybe virtio core is a logical place to keep this.
Users of what? DMA API ops which basically do nothing? Sure — there are
*plenty* of cases where there isn't actually an IOMMU in active use and
the DMA API just returns the same address it was given.
Obviously that happens in platforms without an IOMMU, but it also
happens in cases where an IOMMU exists but is in passthrough mode, and
it also happens in cases where an IOMMU exists somewhere in the system
but only translates for *other* devices.
In all cases, drivers must just use the DMA API and *it* is responsible
for doing the right thing.
> I don't have a problem with extending DMA API to address
> more usecases.
No, this isn't an extension. This is fixing a bug, on certain platforms
where the DMA API has currently done the wrong thing.
We have historically worked around that bug by introducing *another*
bug, which is not to *use* the DMA API in the virtio driver.
Sure, we can co-ordinate those two bug-fixes. But let's not talk about
them as anything other than bug-fixes.
> > Drivers use DMA API. No more talky.
>
> Well for virtio they don't ATM. And 1:1 mapping makes perfect sense
> for the wast majority of users, so I can't switch them over
> until the DMA API actually addresses all existing usecases.
That's still not your business; it's the platform's. And there are
hardware implementations of the virtio protocols on real PCI cards. And
we have the option of doing IOMMU translation for the virtio devices
even in a virtual machine. Just don't get involved.
--
dwmw2
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5691 bytes)
Powered by blists - more mailing lists