From: "Michael S. Tsirkin" <mst@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: virtio-dev@lists.oasis-open.org,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Linux Virtualization <virtualization@lists.linux-foundation.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
"linux390@de.ibm.com" <linux390@de.ibm.com>
Subject: Re: [PATCH 0/3] virtio: Clean up scatterlists and use the DMA API
Date: Wed, 27 Aug 2014 17:45:37 +0200 [thread overview]
Message-ID: <20140827154537.GB18900@redhat.com> (raw)
In-Reply-To: <CALCETrUWR8p7XSiTALd19LL4mTgkXu_XEewobouz6Jbkb4KjLw@mail.gmail.com>
On Wed, Aug 27, 2014 at 08:11:15AM -0700, Andy Lutomirski wrote:
> On Aug 26, 2014 11:46 PM, "Stefan Hajnoczi" <stefanha@gmail.com> wrote:
> >
> > On Tue, Aug 26, 2014 at 10:16 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> > > There are two outstanding issues. virtio_net warns if DMA debugging
> > > is on because it does DMA from the stack. (The warning is correct.)
> > > This also is likely to do something unpleasant to s390.
> > > (Maintainers are cc'd -- I don't know what to do about it.)
> >
> > This changes the semantics of vring and breaks existing guests when
> > bus address != physical address.
> >
> > Can you use a transport feature bit to indicate that bus addresses are
> > used? That way both approaches can be supported.
>
> I can try to support both styles of addressing, but I don't think that
> this can be negotiated between the device (i.e. host or physical
> virtio-speaking device) and the guest. In the Xen case that I care
> about (Linux on Xen on KVM), the host doesn't know about the
> translation at all -- Xen is an intermediate layer that only the guest
> is aware of. In this case, there are effectively two layers of
> virtualization, and only the inner one (Xen) knows about the
> translation despite the fact that the the outer layer is the one
> providing the virtio device.
>
> I could change virtio_ring to use the DMA API only if requested by the
> lower driver (virtio_pci, etc) and to have only virtio_pci enable that
> feature. Will that work for all cases?
>
> On s390, this shouldn't work just like the current code. On x86, I
> think that if QEMU ever starts exposing an IOMMU attached to a
> virtio-pci device, then QEMU should expect that IOMMU to be used. If
> QEMU expects to see physical addresses, then it shouldn't advertise an
> IOMMU. Since QEMU doesn't currently support guest IOMMUs, this should
> be fine for everything that uses QEMU.
>
> At least x86's implementation of the DMA ops for devices that aren't
> behind an IOMMU should be very fast.
>
> Are there any other weird cases for which this might be a problem?
>
> >
> > Please also update the virtio specification:
> > https://tools.oasis-open.org/version-control/browse/wsvn/virtio/
> >
>
> I'm not sure it will need an update. Perhaps a note in the PCI
> section indicating that, if the host expects the guest to program an
> IOMMU, then it should use the appropriate platform-specific mechanism
> to expose that IOMMU.
>
> --Andy
If there's no virtio mechanism to negotate enabling/disabling
translations, then specification does not need an extension.
--
MST
next prev parent reply other threads:[~2014-08-27 15:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 21:16 [PATCH 0/3] virtio: Clean up scatterlists and use the DMA API Andy Lutomirski
2014-08-26 21:17 ` [PATCH 1/3] virtio_ring: Remove sg_next indirection Andy Lutomirski
2014-09-01 0:58 ` Rusty Russell
2014-09-01 1:42 ` Andy Lutomirski
2014-09-01 6:59 ` Michael S. Tsirkin
2014-09-01 17:15 ` Andy Lutomirski
2014-08-26 21:17 ` [PATCH 2/3] virtio_ring: Use DMA APIs Andy Lutomirski
2014-08-27 7:29 ` Christian Borntraeger
2014-08-27 17:35 ` Konrad Rzeszutek Wilk
2014-08-27 17:39 ` Andy Lutomirski
2014-08-26 21:17 ` [PATCH 3/3] virtio_pci: Use the DMA API for virtqueues Andy Lutomirski
2014-08-27 17:32 ` Konrad Rzeszutek Wilk
2014-08-27 17:35 ` Andy Lutomirski
2014-08-27 18:52 ` Konrad Rzeszutek Wilk
2014-08-27 6:46 ` [PATCH 0/3] virtio: Clean up scatterlists and use the DMA API Stefan Hajnoczi
2014-08-27 15:11 ` Andy Lutomirski
2014-08-27 15:45 ` Michael S. Tsirkin [this message]
2014-08-27 15:50 ` Andy Lutomirski
2014-08-27 16:13 ` Christopher Covington
2014-08-27 16:19 ` Andy Lutomirski
2014-08-27 17:34 ` Christopher Covington
2014-08-27 17:37 ` Andy Lutomirski
2014-08-27 17:50 ` Christopher Covington
2014-08-27 20:52 ` Christian Borntraeger
2014-08-27 17:27 ` Konrad Rzeszutek Wilk
2014-08-27 18:10 ` Stefan Hajnoczi
2014-08-27 18:58 ` Konrad Rzeszutek Wilk
2014-08-27 7:54 ` Cornelia Huck
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=20140827154537.GB18900@redhat.com \
--to=mst@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=borntraeger@de.ibm.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=luto@amacapital.net \
--cc=virtio-dev@lists.oasis-open.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).