From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Cc: iommu@lists.linux-foundation.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org,
virtio-dev@lists.oasis-open.org, cdall@linaro.org,
will.deacon@arm.com, robin.murphy@arm.com,
lorenzo.pieralisi@arm.com, joro@8bytes.org, jasowang@redhat.com,
alex.williamson@redhat.com, marc.zyngier@arm.com
Subject: Re: [virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU
Date: Mon, 10 Apr 2017 23:04:45 +0300 [thread overview]
Message-ID: <20170410230139-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <c6bb7071-f419-1346-7985-e9b4718894a8@arm.com>
On Mon, Apr 10, 2017 at 07:39:24PM +0100, Jean-Philippe Brucker wrote:
> On 07/04/17 22:19, Michael S. Tsirkin wrote:
> > On Fri, Apr 07, 2017 at 08:17:44PM +0100, Jean-Philippe Brucker wrote:
> >> There are a number of advantages in a paravirtualized IOMMU over a full
> >> emulation. It is portable and could be reused on different architectures.
> >> It is easier to implement than a full emulation, with less state tracking.
> >> It might be more efficient in some cases, with less context switches to
> >> the host and the possibility of in-kernel emulation.
> >
> > Thanks, this is very interesting. I am read to read it all, but I really
> > would like you to expand some more on the motivation for this work.
> > Productising this would be quite a bit of work. Spending just 6 lines on
> > motivation seems somewhat disproportionate. In particular, do you have
> > any specific efficiency measurements or estimates that you can share?
>
> The main motivation for this work is to bring IOMMU virtualization to the
> ARM world. We don't have any at the moment, and a full ARM SMMU
> virtualization solution would be counter-productive. We would have to do
> it for SMMUv2, for the completely orthogonal SMMUv3, and for any future
> version of the architecture. Doing so in userspace might be acceptable,
> but then for performance reasons people will want in-kernel emulation of
> every IOMMU variant out there, which is a maintenance and security
> nightmare. A single generic vIOMMU is preferable because it reduces
> maintenance cost and attack surface.
>
> The transport code is the same as any virtio device, both for userspace
> and in-kernel implementations. So instead of rewriting everything from
> scratch (and the lot of bugs that go with it) for each IOMMU variation, we
> reuse well-tested code for transport and write the emulation layer once
> and for all.
>
> Note that this work applies to any architecture with an IOMMU, not only
> ARM and their partners'. Introducing an IOMMU specially designed for
> virtualization allows us to get rid of complex state tracking inherent to
> full IOMMU emulations. With a full emulation, all guest accesses to page
> table and configuration structures have to be trapped and interpreted. A
> Virtio interface provides well-defined semantics and doesn't need to guess
> what the guest is trying to do. It transmits requests made from guest
> device drivers to host IOMMU almost unaltered, removing the intermediate
> layer of arch-specific configuration structures and page tables.
>
> Using a portable standard like Virtio also allows for efficient IOMMU
> virtualization when guest and host are built for different architectures
> (for instance when using Qemu TCG.) In-kernel emulation would still work
> with vhost-iommu, but a platform-specific vIOMMUs would have to stay in
> userspace.
>
> I don't have any measurements at the moment, it is a bit early for that.
> The kvmtool example was developed on a software model and is mostly here
> for illustrative purpose, a Qemu implementation would be more suitable for
> performance analysis. I wouldn't be able to give meaning to these numbers
> anyway, since on ARM we don't have any existing solution to compare it
> against. One could compare the complexity of handling guest accesses and
> parsing page tables in Qemu's VT-d emulation with reading a chain of
> buffers in Virtio, for a very rough estimate.
>
> Thanks,
> Jean-Philippe
This last suggestion sounds very reasonable.
--
MST
next prev parent reply other threads:[~2017-04-10 20:04 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 19:17 [RFC 0/3] virtio-iommu: a paravirtualized IOMMU Jean-Philippe Brucker
[not found] ` <20170407191747.26618-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-04-07 19:17 ` [RFC 1/3] virtio-iommu: firmware description of the virtual topology Jean-Philippe Brucker
[not found] ` <20170407191747.26618-2-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-04-18 9:51 ` Tian, Kevin
2017-04-18 18:41 ` Jean-Philippe Brucker
2017-04-21 8:43 ` Tian, Kevin
[not found] ` <AADFC41AFE54684AB9EE6CBC0274A5D190CB2570-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-04-24 15:05 ` Jean-Philippe Brucker
2017-04-10 2:30 ` Need information on type 2 IOMMU valmiki
[not found] ` <1b48daab-c9e1-84d1-78a9-84d3e2001f32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-10 4:19 ` Alex Williamson
2017-04-13 8:41 ` [RFC 0/3] virtio-iommu: a paravirtualized IOMMU Tian, Kevin
2017-04-13 13:12 ` Jean-Philippe Brucker
2017-04-07 19:17 ` [RFC 2/3] virtio-iommu: device probing and operations Jean-Philippe Brucker
2017-04-18 10:26 ` Tian, Kevin
2017-04-18 18:45 ` Jean-Philippe Brucker
2017-04-21 9:02 ` Tian, Kevin
[not found] ` <AADFC41AFE54684AB9EE6CBC0274A5D190CB262D-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-04-24 15:05 ` Jean-Philippe Brucker
2017-08-21 7:59 ` Tian, Kevin
2017-08-21 12:00 ` Jean-Philippe Brucker
[not found] ` <454095c4-cae5-ad52-a459-5c9e2cce4047-5wv7dgnIgG8@public.gmane.org>
2017-08-22 6:24 ` Tian, Kevin
2017-08-22 14:19 ` Jean-Philippe Brucker
2017-08-23 2:23 ` Tian, Kevin
2017-04-07 19:17 ` [RFC 3/3] virtio-iommu: future work Jean-Philippe Brucker
[not found] ` <20170407191747.26618-4-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-04-21 8:31 ` Tian, Kevin
2017-04-24 15:05 ` Jean-Philippe Brucker
2017-04-26 16:24 ` Michael S. Tsirkin
2017-04-07 19:23 ` [RFC PATCH linux] iommu: Add virtio-iommu driver Jean-Philippe Brucker
2017-06-16 8:48 ` [virtio-dev] " Bharat Bhushan
2017-06-16 11:36 ` Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 00/15] Add virtio-iommu Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 01/15] virtio: synchronize virtio-iommu headers with Linux Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 02/15] FDT: (re)introduce a dynamic phandle allocator Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 03/15] virtio: add virtio-iommu Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 04/15] Add a simple IOMMU Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 05/15] iommu: describe IOMMU topology in device-trees Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 06/15] irq: register MSI doorbell addresses Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 07/15] virtio: factor virtqueue initialization Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 08/15] virtio: add vIOMMU instance for virtio devices Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 09/15] virtio: access vring and buffers through IOMMU mappings Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 10/15] virtio-pci: translate MSIs with the virtual IOMMU Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 11/15] virtio: set VIRTIO_F_IOMMU_PLATFORM when necessary Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 12/15] vfio: add support for virtual IOMMU Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 13/15] virtio-iommu: debug via IPC Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 14/15] virtio-iommu: implement basic debug commands Jean-Philippe Brucker
2017-04-07 19:24 ` [RFC PATCH kvmtool 15/15] virtio: use virtio-iommu when available Jean-Philippe Brucker
[not found] ` <20170407192455.26814-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2017-05-22 8:26 ` [RFC PATCH kvmtool 00/15] Add virtio-iommu Bharat Bhushan
[not found] ` <AM5PR0401MB2545FADDF2A7649DF0DB68309AF80-oQ3wXcTHOqrg6d/1FbYcvI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-05-22 14:01 ` Jean-Philippe Brucker
2017-04-07 21:19 ` [RFC 0/3] virtio-iommu: a paravirtualized IOMMU Michael S. Tsirkin
2017-04-10 18:39 ` Jean-Philippe Brucker
2017-04-10 20:04 ` Michael S. Tsirkin [this message]
2017-04-12 9:06 ` Jason Wang
[not found] ` <a0920e37-a11e-784c-7d90-be6617ea7686-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-13 8:16 ` Tian, Kevin
[not found] ` <AADFC41AFE54684AB9EE6CBC0274A5D190CA990E-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-04-13 13:12 ` Jean-Philippe Brucker
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=20170410230139-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=cdall@linaro.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jasowang@redhat.com \
--cc=jean-philippe.brucker@arm.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.zyngier@arm.com \
--cc=robin.murphy@arm.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=will.deacon@arm.com \
/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).