From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
virtualization@lists.linux-foundation.org,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: virtio DMA API?
Date: Wed, 27 Aug 2014 13:52:50 +0200 [thread overview]
Message-ID: <20140827115249.GA16850@redhat.com> (raw)
In-Reply-To: <87iole89xg.fsf@rustcorp.com.au>
On Wed, Aug 27, 2014 at 08:40:51PM +0930, Rusty Russell wrote:
> Andy Lutomirski <luto@amacapital.net> writes:
> > Currently, a lot of the virtio code assumes that bus (i.e. hypervisor)
> > addresses are the same as physical address. This is false on Xen, so
> > virtio is completely broken. I wouldn't be surprised if it also
> > becomes a problem the first time that someone sticks a physical
> > "virtio" device on a 32-bit bus on an ARM SOC with more than 4G RAM.
> >
> > Would you accept patches to convert virtio_ring and virtio_pci to use
> > the DMA APIs? I think that the only real catch will be that
> > virtio_ring's approach to freeing indirect blocks is currently
> > incompatible with the DMA API -- it assumes that knowing the bus
> > address is enough to call kfree, and I don't think that the DMA API
> > provides a reverse mapping like that.
>
> Hi Andy,
>
> This has long been a source of contention. virtio assumes that
> the hypervisor can decode guest-physical addresses.
>
> PowerPC, in particular, doesn't want to pay the cost of IOMMU
> manipulations, and all arguments presented so far for using an IOMMU for
> a virtio device are weak. And changing to use DMA APIs would break them
> anyway.
>
> Of course, it's Just A Matter of Code, so it's possible to
> create a Xen-specific variant which uses the DMA APIs. I'm not sure
> what that would look like in the virtio standard, however.
>
> Cheers,
> Rusty.
For x86 as of QEMU 2.0 there's no iommu.
So a reasonable thing to do for that platform
might be to always use iommu *if it's there*.
My understanding is this isn't the case for powerpc?
--
MST
next prev parent reply other threads:[~2014-08-27 11:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 17:18 virtio DMA API? Andy Lutomirski
2014-08-25 18:54 ` Konrad Rzeszutek Wilk
2014-08-25 19:20 ` Andy Lutomirski
2014-08-27 11:10 ` Rusty Russell
2014-08-27 11:52 ` Michael S. Tsirkin [this message]
2014-08-27 19:49 ` Konrad Rzeszutek Wilk
2014-08-27 21:32 ` Benjamin Herrenschmidt
2014-08-27 14:55 ` Andy Lutomirski
2014-08-27 21:31 ` Benjamin Herrenschmidt
2014-08-29 15:06 ` Konrad Rzeszutek Wilk
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=20140827115249.GA16850@redhat.com \
--to=mst@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=konrad.wilk@oracle.com \
--cc=luto@amacapital.net \
--cc=rusty@rustcorp.com.au \
--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.