From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Aviv B.D." <bd.aviv@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 0/3] IOMMU: intel_iommu support map and unmap notifications
Date: Wed, 16 Nov 2016 21:57:30 +0200 [thread overview]
Message-ID: <20161116215519-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAM3WwMgH-HBj6L3b6cjU_sEGxLghksKAZX+sYu9iQcxXNXcoRQ@mail.gmail.com>
On Wed, Nov 16, 2016 at 09:50:46PM +0200, Aviv B.D. wrote:
>
>
> On Wed, Nov 16, 2016 at 5:34 PM, Alex Williamson <alex.williamson@redhat.com>
> wrote:
>
> On Wed, 16 Nov 2016 15:54:56 +0200
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> > On Thu, Nov 10, 2016 at 12:44:47PM -0700, Alex Williamson wrote:
> > > On Thu, 10 Nov 2016 21:20:36 +0200
> > > "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > >
> > > > On Thu, Nov 10, 2016 at 09:04:13AM -0700, Alex Williamson wrote:
> > > > > On Thu, 10 Nov 2016 17:54:35 +0200
> > > > > "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > > > >
> > > > > > On Thu, Nov 10, 2016 at 08:30:21AM -0700, Alex Williamson wrote:
> > > > > > > On Thu, 10 Nov 2016 17:14:24 +0200
> > > > > > > "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > > > > > >
> > > > > > > > On Tue, Nov 08, 2016 at 01:04:21PM +0200, Aviv B.D wrote:
> > > > > > > > > From: "Aviv Ben-David" <bd.aviv@gmail.com>
> > > > > > > > >
> > > > > > > > > * Advertize Cache Mode capability in iommu cap register.
> > > > > > > > > This capability is controlled by "cache-mode" property of
> intel-iommu device.
> > > > > > > > > To enable this option call QEMU with "-device
> intel-iommu,cache-mode=true".
> > > > > > > > >
> > > > > > > > > * On page cache invalidation in intel vIOMMU, check if the
> domain belong to
> > > > > > > > > registered notifier, and notify accordingly.
> > > > > > > >
> > > > > > > > This looks sane I think. Alex, care to comment?
> > > > > > > > Merging will have to wait until after the release.
> > > > > > > > Pls remember to re-test and re-ping then.
> > > > > > >
> > > > > > > I don't think it's suitable for upstream until there's a
> reasonable
> > > > > > > replay mechanism
> > > > > >
> > > > > > Could you pls clarify what do you mean by replay?
> > > > > > Is this when you attach a device by hotplug to
> > > > > > a running system?
> > > > > >
> > > > > > If yes this can maybe be addressed by disabling hotplug
> temporarily.
> > > > >
> > > > > No, hotplug is not required, moving a device between existing
> domains
> > > > > requires replay, ie. actually using it for nested device
> assignment.
> > > >
> > > > Good point, that one is a correctness thing. Aviv,
> > > > could you add this in TODO list in a cover letter pls?
> > > >
> > > > > > > and we straighten out whether it's expected to get
> > > > > > > multiple notifies and the notif-ee is responsible for filtering
> > > > > > > them or if the notif-er should do filtering.
> > > > > >
> > > > > > OK this is a documentation thing.
> > > > >
> > > > > Well no, it needs to be decided and if necessary implemented.
> > > >
> > > > Let's assume it's the notif-ee for now. Less is more and all that.
> > >
> > > I think this is opposite of the approach dwg suggested.
> > >
> > > > > > > Without those, this is
> > > > > > > effectively just an RFC.
> > > > > >
> > > > > > It's infrastructure without users so it doesn't break things,
> > > > > > I'm more interested in seeing whether it's broken in
> > > > > > some way than whether it's complete.
> > > > >
> > > > > If it allows use with vfio but doesn't fully implement the complete
> set
> > > > > of interfaces, it does break things. We currently prevent viommu
> usage
> > > > > with vfio because it is incomplete.
> > > >
> > > > Right - that bit is still in as far as I can see.
> > >
> > > Nope, 3/3 changes vtd_iommu_notify_flag_changed() to allow use with
> > > vfio even though it's still incomplete. We would at least need
> > > something like a replay callback for VT-d that triggers an abort if you
> > > still want to accept it incomplete. Thanks,
> > >
> > > Alex
> >
> > IIUC practically things seems to work, right?
>
> AFAIK, no.
>
> > So how about disabling by default with a flag for people that want to
> > experiment with it?
> > E.g. x-vfio-allow-broken-translations ?
>
> We've already been through one round of "intel-iommu is incomplete for
> use with device assignment, how can we prevent it from being used",
> which led to the notify_flag_changed callback on MemoryRegionIOMMUOps.
> This series now claims to fix that yet still doesn't provide a
> mechanism to do memory_region_iommu_replay() given that VT-d has a much
> larger address width. Why is the onus on vfio to resolve this or
> provide some sort of workaround? vfio is using the QEMU iommu
> interface correctly, intel-iommu is still incomplete. The least it
> could do is add an optional replay callback to MemoryRegionIOMMUOps
> that supersedes the existing memory_region_iommu_replay() code and
> triggers an abort when it gets called. I don't know what an
> x-vfio-allow-broken-translations option would do, how I'd implement it,
> or why I'd bother to implement it. Thanks,
>
> Alex
>
>
> I'll implement your suggestion regarding the replay framwork.
> Probably in another patch set, if it is OK?
>
> Thanks,
> Aviv.
>
Alex points out that with 3/3 setting cache_mode=1 will enable VFIO
device assignment. Question would be, does it actually work for you
in this mode? If not it seems important not to enable it for users.
--
MST
next prev parent reply other threads:[~2016-11-16 19:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 11:04 [Qemu-devel] [PATCH v6 0/3] IOMMU: intel_iommu support map and unmap notifications Aviv B.D
2016-11-08 11:04 ` [Qemu-devel] [PATCH v6 1/3] IOMMU: add option to enable VTD_CAP_CM to vIOMMU capility exposoed to guest Aviv B.D
2016-11-09 7:28 ` Jason Wang
2016-11-09 22:00 ` Michael S. Tsirkin
2016-11-11 2:32 ` Jason Wang
2016-11-11 3:39 ` Michael S. Tsirkin
2016-11-11 4:15 ` Jason Wang
2016-11-21 12:41 ` Aviv B.D.
2016-11-22 3:59 ` Jason Wang
2016-11-21 13:35 ` Michael S. Tsirkin
2016-11-22 4:11 ` Jason Wang
2016-11-22 13:15 ` Aviv B.D.
2016-11-22 15:13 ` Michael S. Tsirkin
2016-11-22 15:09 ` Michael S. Tsirkin
2016-12-01 3:02 ` Tian, Kevin
2016-11-08 11:04 ` [Qemu-devel] [PATCH v6 2/3] IOMMU: change iommu_op->translate's is_write to flags, add support to NO_FAIL flag mode Aviv B.D
2016-11-08 11:04 ` [Qemu-devel] [PATCH v6 3/3] IOMMU: enable intel_iommu map and unmap notifiers Aviv B.D
2016-11-10 15:13 ` Michael S. Tsirkin
2016-11-10 15:14 ` [Qemu-devel] [PATCH v6 0/3] IOMMU: intel_iommu support map and unmap notifications Michael S. Tsirkin
2016-11-10 15:30 ` Alex Williamson
2016-11-10 15:54 ` Michael S. Tsirkin
2016-11-10 16:04 ` Alex Williamson
2016-11-10 19:20 ` Michael S. Tsirkin
2016-11-10 19:44 ` Alex Williamson
2016-11-16 13:54 ` Michael S. Tsirkin
2016-11-16 15:34 ` Alex Williamson
2016-11-16 19:50 ` Aviv B.D.
2016-11-16 19:57 ` Michael S. Tsirkin [this message]
2016-11-21 11:36 ` Aviv B.D.
2016-11-16 20:03 ` Alex Williamson
2016-11-16 20:17 ` Michael S. Tsirkin
2016-11-16 19:20 ` Aviv B.D.
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=20161116215519-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=bd.aviv@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.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.