From: "Michael S. Tsirkin" <mst@redhat.com>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
robh@kernel.org, aik@ozlabs.ru, jasowang@redhat.com,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, joe@perches.com,
david@gibson.dropbear.id.au, linuxppc-dev@lists.ozlabs.org,
elfring@users.sourceforge.net
Subject: Re: [RFC] virtio: Use DMA MAP API for devices without an IOMMU
Date: Wed, 18 Apr 2018 19:20:10 +0300 [thread overview]
Message-ID: <20180418191722-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <002f153f-452d-f64b-4fc7-7f3383b39162@linux.vnet.ibm.com>
On Wed, Apr 18, 2018 at 08:47:10AM +0530, Anshuman Khandual wrote:
> On 04/15/2018 05:41 PM, Christoph Hellwig wrote:
> > On Fri, Apr 06, 2018 at 06:37:18PM +1000, Benjamin Herrenschmidt wrote:
> >>>> implemented as DMA API which the virtio core understands. There is no
> >>>> need for an IOMMU to be involved for the device representation in this
> >>>> case IMHO.
> >>>
> >>> This whole virtio translation issue is a mess. I think we need to
> >>> switch it to the dma API, and then quirk the legacy case to always
> >>> use the direct mapping inside the dma API.
> >>
> >> Fine with using a dma API always on the Linux side, but we do want to
> >> special case virtio still at the arch and qemu side to have a "direct
> >> mapping" mode. Not sure how (special flags on PCI devices) to avoid
> >> actually going through an emulated IOMMU on the qemu side, because that
> >> slows things down, esp. with vhost.
> >>
> >> IE, we can't I think just treat it the same as a physical device.
> >
> > We should have treated it like a physical device from the start, but
> > that device has unfortunately sailed.
> >
> > But yes, we'll need a per-device quirk that says 'don't attach an
> > iommu'.
>
> How about doing it per platform basis as suggested in this RFC through
> an arch specific callback. Because all the virtio devices in the given
> platform would require and exercise this option (to avail bounce buffer
> mechanism for secure guests as an example). So the flag basically is a
> platform specific one not a device specific one.
That's not the case. A single platform can have a mix of virtio and
non-virtio devices. Same applies even within virtio, e.g. the balloon
device always bypasses an iommu. Further, QEMU supports out of process
devices some of which might bypass the IOMMU.
--
MST
next prev parent reply other threads:[~2018-04-18 16:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 10:56 [RFC] virtio: Use DMA MAP API for devices without an IOMMU Anshuman Khandual
2018-04-05 11:14 ` Balbir Singh
2018-04-05 11:14 ` Balbir Singh
2018-04-05 11:28 ` Anshuman Khandual
2018-04-05 11:28 ` Anshuman Khandual
2018-04-05 14:39 ` Anshuman Khandual
2018-04-05 14:39 ` Anshuman Khandual
2018-04-05 14:54 ` Michael S. Tsirkin
2018-04-05 15:09 ` Benjamin Herrenschmidt
2018-04-05 15:09 ` Benjamin Herrenschmidt
2018-04-05 18:34 ` Michael S. Tsirkin
2018-04-05 21:18 ` Benjamin Herrenschmidt
2018-04-05 21:18 ` Benjamin Herrenschmidt
2018-04-06 2:53 ` Anshuman Khandual
2018-04-06 2:53 ` Anshuman Khandual
2018-04-06 7:16 ` Christoph Hellwig
2018-04-06 7:16 ` Christoph Hellwig
2018-04-06 8:37 ` Benjamin Herrenschmidt
2018-04-06 8:37 ` Benjamin Herrenschmidt
2018-04-15 12:11 ` Christoph Hellwig
2018-04-15 12:11 ` Christoph Hellwig
2018-04-18 3:17 ` Anshuman Khandual
2018-04-18 3:17 ` Anshuman Khandual
2018-04-18 16:20 ` Michael S. Tsirkin [this message]
2018-05-01 16:34 ` Ram Pai
2018-04-18 16:20 ` Michael S. Tsirkin
2018-04-05 18:34 ` Michael S. Tsirkin
2018-04-05 14:54 ` Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2018-04-05 10:56 Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180418191722-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=elfring@users.sourceforge.net \
--cc=hch@infradead.org \
--cc=jasowang@redhat.com \
--cc=joe@perches.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=robh@kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.