From: David Gibson <david@gibson.dropbear.id.au>
To: Jason Wang <jasowang@redhat.com>
Cc: Peter Xu <peterx@redhat.com>,
qemu-devel@nongnu.org, mst@redhat.com, vkaplans@redhat.com,
alex.williamson@redhat.com, wexu@redhat.com, pbonzini@redhat.com,
cornelia.huck@de.ibm.com, dgibson@redhat.com
Subject: Re: [Qemu-devel] [PATCH 0/3] memory: add IOMMU notifier type
Date: Wed, 7 Sep 2016 14:38:16 +1000 [thread overview]
Message-ID: <20160907043816.GL2780@voom.fritz.box> (raw)
In-Reply-To: <782f9fec-498d-a121-b961-d9cb9a1c9473@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3504 bytes --]
On Tue, Sep 06, 2016 at 02:26:44PM +0800, Jason Wang wrote:
>
>
> On 2016年09月06日 13:49, Peter Xu wrote:
> > On Tue, Sep 06, 2016 at 03:06:17PM +1000, David Gibson wrote:
> > > On Mon, Sep 05, 2016 at 03:21:18PM +0800, Peter Xu wrote:
> > > > In the thread:
> > > >
> > > > https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg00254.html
> > > >
> > > > Alex proposed a way for vhost DMAR to be enabled without breaking
> > > > existing protections on vIOMMU and device assignments. This series
> > > > tried to implement the idea, by introducing a IOMMU notifier type for
> > > > each IOMMU memory region.
> > > Hrm, I'm pretty dubious about this concept, since it's basically just
> > > an interim hack for an incomplete notifier implementation on x86.
> > > What makes just fixing the notifier so difficult?
> > Aviv is working on the full notifier support for that. It's been
> > months since his last post though. If he cannot continue it (due to
> > any reason), I can take it over. But for now, we may still need to
> > wait for his patches to fully enable a complete notifier mechanism.
>
> Yes, and the issue is:
>
> - There's no way for current intel IOMMU code to be notified when guest map
> a page. So it's impossible for intel IOMMU to co-work with vfio now.
> - A solution is caching mode (CM) support which requires a TLB invalidation
> even if it was a non-present to present changing, but this is still under
> development.
Right. AIUI the whole point of CM is to allow this sort of
virtualization.
What I hadn't reaalized before was that even with CM==0, invalidations
were still notified, otherwise I didn't see how anything was possible.
> - VT-d spec requires: "Hardware implementations of this architecture must
> support operation corresponding to CM=0." So even if we have CM mode which
> can work with vfio, we still must support intel IOMMU with CM disabled. It
> was not only a spec requirement but also a performance consideration. (CM is
> usually slower)
Well.. this isn't a hardware implementation, so I don't think it's
really a spec requirement, although I can see why you'd want it so
that you can do something as near as possible indistinguishable from
hardware.
> So in conclusion, there's a mode for intel IOMMU that can't work with vfio
> at all. Fixing the notifier does not solve this since the notifier won't be
> able to be triggered.
Ok, I understand. CM==1 will be able to have the full notifier, but
CM==0 won't and will never work with VFIO, so we need a way to detect
that cleanly.
>
> >
> > I don't know how POWER works to provide a complete notifier, and
> > whether POWER can selectively enable the notified items... But for
> > Intel VT-d, it provided two choices: by default, only cache
> > invalidations are notified (even, we can disalbe cache invaliations),
> > but if one want to have a complete notifier, just set the CM bit to 1.
> > So I just think it'll be cool if we can support both cases. E.g., for
> > vhost, it does not need to be notified with newly added entries, but
> > only cache invalidations. IMHO we can't just force vhost to use a
> > complete notifier while actually it only needs part of it.
> >
> > Thanks,
> >
> > -- peterx
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
prev parent reply other threads:[~2016-09-07 4:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 7:21 [Qemu-devel] [PATCH 0/3] memory: add IOMMU notifier type Peter Xu
2016-09-05 7:21 ` [Qemu-devel] [PATCH 1/3] memory: add one flag for IOMMU notifier Peter Xu
2016-09-05 7:21 ` [Qemu-devel] [PATCH 2/3] memory: add iommu_notify_flag Peter Xu
2016-09-05 8:04 ` Paolo Bonzini
2016-09-05 8:38 ` Peter Xu
2016-09-05 9:56 ` Paolo Bonzini
2016-09-06 5:27 ` Peter Xu
2016-09-06 7:51 ` Paolo Bonzini
2016-09-06 8:17 ` Peter Xu
2016-09-06 8:19 ` Paolo Bonzini
2016-09-06 10:31 ` Peter Xu
2016-09-07 5:44 ` David Gibson
2016-09-07 6:34 ` Peter Xu
2016-09-07 6:41 ` David Gibson
2016-09-08 9:07 ` Peter Xu
2016-09-12 1:26 ` David Gibson
2016-09-12 5:13 ` Peter Xu
2016-09-14 4:00 ` David Gibson
2016-09-14 5:43 ` Peter Xu
2016-09-06 5:18 ` David Gibson
2016-09-06 5:55 ` Peter Xu
2016-09-06 5:12 ` David Gibson
2016-09-06 5:33 ` Peter Xu
2016-09-05 7:21 ` [Qemu-devel] [PATCH 3/3] intel_iommu: allow IOMMU_NONE typed notifiers Peter Xu
2016-09-06 5:06 ` [Qemu-devel] [PATCH 0/3] memory: add IOMMU notifier type David Gibson
2016-09-06 5:49 ` Peter Xu
2016-09-06 6:26 ` Jason Wang
2016-09-07 4:38 ` David Gibson [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=20160907043816.GL2780@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=alex.williamson@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dgibson@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vkaplans@redhat.com \
--cc=wexu@redhat.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 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.