From: "Michael S. Tsirkin" <mst@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Joerg Roedel <joro@8bytes.org>, Jason Wang <jasowang@redhat.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jens Axboe <axboe@kernel.dk>,
virtualization@lists.linux-foundation.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, jfehlig@suse.com,
jon.grimm@amd.com, brijesh.singh@amd.com
Subject: Re: [PATCH 0/3] Fix virtio-blk issue with SWIOTLB
Date: Wed, 16 Jan 2019 09:16:05 -0500 [thread overview]
Message-ID: <20190116091048-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190115132019.GA28778@lst.de>
On Tue, Jan 15, 2019 at 02:20:19PM +0100, Christoph Hellwig wrote:
> On Tue, Jan 15, 2019 at 09:37:42AM +0100, Joerg Roedel wrote:
> > On Mon, Jan 14, 2019 at 01:20:45PM -0500, Michael S. Tsirkin wrote:
> > > Which would be fine especially if we can manage not to introduce a bunch
> > > of indirect calls all over the place and hurt performance.
> >
> > Which indirect calls? In case of unset dma_ops the DMA-API functions
> > call directly into the dma-direct implementation, no indirect calls at
> > all.
>
> True. But the NULL-ops dma direct case still has two issues that might
> not work for virtio:
>
> (a) if the architecture supports devices that are not DMA coherent it
> will dip into a special allocator and do cache maintainance for
> streaming mappings. Although it would be a bit of a hack we could
> work around this in virtio doings something like:
>
> #if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
> defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
> defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
> dev->dma_coherent = true;
> #endif
>
> except that won't work for mips, which has a mode where it does
> a system instead of device level coherency flag and thus doesn't
> look at this struct device field
>
> (b) we can still mangle the DMA address, either using the
> dma_pfn_offset field in struct device, or by a full override
> of __phys_to_dma / __dma_to_phys by the architecture code.
> The first could be solved using a hack like the one above,
> but the latter would be a little harder. In the long run
> I'd love to get rid of that hook and have everyone use the
> generic offset code, but for that we first need to support
> multiple ranges with different offset and do quite some
> nasty arch code surgery.
>
> So for the legacy virtio case I fear we need to keep local dma mapping
> implementation for now. I just wish now recent hypervisor would ever
> offer devices in this broken legacy mode..
IIUC some emulated hardware has no reasonable way to specify that
some devices bypass the IOMMU, and no cheap way to cover all
memory with an IOMMU mapping.
So I suspect !ACCESS_PLATFORM will stay a supported configuration
forever :(
> >
> > Regards,
> >
> > Joerg
> ---end quoted text---
prev parent reply other threads:[~2019-01-16 14:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 13:44 [PATCH 0/3] Fix virtio-blk issue with SWIOTLB Joerg Roedel
2019-01-10 13:44 ` [PATCH 1/3] swiotlb: Export maximum allocation size Joerg Roedel
2019-01-10 17:02 ` Konrad Rzeszutek Wilk
2019-01-11 9:12 ` Joerg Roedel
2019-01-14 20:49 ` Konrad Rzeszutek Wilk
2019-01-14 21:59 ` Michael S. Tsirkin
2019-01-15 13:05 ` Christoph Hellwig
2019-01-10 13:44 ` [PATCH 2/3] virtio: Introduce virtio_max_dma_size() Joerg Roedel
2019-01-10 13:44 ` [PATCH 3/3] virtio-blk: Consider virtio_max_dma_size() for maximum segment size Joerg Roedel
2019-01-10 13:59 ` [PATCH 0/3] Fix virtio-blk issue with SWIOTLB Christoph Hellwig
2019-01-10 14:26 ` Joerg Roedel
2019-01-11 3:29 ` Jason Wang
2019-01-11 9:15 ` Joerg Roedel
2019-01-14 9:41 ` Jason Wang
2019-01-14 9:50 ` Christoph Hellwig
2019-01-14 12:41 ` Jason Wang
2019-01-14 18:20 ` Michael S. Tsirkin
2019-01-14 19:09 ` Singh, Brijesh
2019-01-14 19:12 ` Robin Murphy
2019-01-14 20:22 ` Christoph Hellwig
2019-01-14 20:29 ` Michael S. Tsirkin
2019-01-14 20:19 ` Christoph Hellwig
2019-01-14 20:48 ` Michael S. Tsirkin
2019-01-15 13:09 ` Christoph Hellwig
2019-01-15 8:37 ` Joerg Roedel
2019-01-15 13:20 ` Christoph Hellwig
2019-01-16 14:16 ` Michael S. Tsirkin [this message]
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=20190116091048-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=axboe@kernel.dk \
--cc=brijesh.singh@amd.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jasowang@redhat.com \
--cc=jfehlig@suse.com \
--cc=jon.grimm@amd.com \
--cc=joro@8bytes.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).