qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, jasowang@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 v5 1/3] memory: introduce IOMMUNotifier and its caps
Date: Wed, 21 Sep 2016 13:48:08 +1000	[thread overview]
Message-ID: <20160921034808.GW20488@umbus> (raw)
In-Reply-To: <20160920071633.GD5134@pxdev.xzpeter.org>

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

On Tue, Sep 20, 2016 at 03:16:33PM +0800, Peter Xu wrote:
> On Tue, Sep 20, 2016 at 04:12:05PM +1000, David Gibson wrote:
> > On Wed, Sep 14, 2016 at 04:25:46PM +0800, Peter Xu wrote:
> > > IOMMU Notifier list is used for notifying IO address mapping changes.
> > > Currently VFIO is the only user.
> > > 
> > > However it is possible that future consumer like vhost would like to
> > > only listen to part of its notifications (e.g., cache invalidations).
> > > 
> > > This patch introduced IOMMUNotifier and IOMMUNotfierFlag bits for a
> > > finer grained control of it.
> > > 
> > > IOMMUNotifier contains a bitfield for the notify consumer describing
> > > what kind of notification it is interested in. Currently two kinds of
> > > notifications are defined:
> > > 
> > > - IOMMU_NOTIFIER_MAP:    for newly mapped entries (additions)
> > > - IOMMU_NOTIFIER_UNMAP:  for entries to be removed (cache invalidates)
> > > 
> > > When registering the IOMMU notifier, we need to specify one or multiple
> > > types of messages to listen to.
> > > 
> > > When notifications are triggered, its type will be checked against the
> > > notifier's type bits, and only notifiers with registered bits will be
> > > notified.
> > > 
> > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > 
> > I still don't see the big fat comment saying that in-place changes to
> > an IOMMU mapping aren't permitted.
> 
> IMHO if we are using MAP and UNMAP here then it's fairly clear even we
> will support in-place change in the future. I can add one more
> paragraph for in-place change like:
> 
>   For any IOMMU implementation, an in-place mapping change should be
>   notified with an UNMAP following a MAP.
> 
> Do you think this works?

I guess it will do.

> 
> [...]
> 
> > > +struct IOMMUNotifier {
> > > +    void (*notify)(struct IOMMUNotifier *notifier, void *data);
> > 
> > Given that we now have a special notifier type for this purpose, we
> > could actually type this to take an IOMMUTLBEntry instead of a void *.
> 
> Yep. I can fix that.

Great.

-- 
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: 819 bytes --]

  reply	other threads:[~2016-09-21  3:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  8:25 [Qemu-devel] [PATCH v5 0/3] Introduce IOMMUNotifier struct Peter Xu
2016-09-14  8:25 ` [Qemu-devel] [PATCH v5 1/3] memory: introduce IOMMUNotifier and its caps Peter Xu
2016-09-20  6:12   ` David Gibson
2016-09-20  7:16     ` Peter Xu
2016-09-21  3:48       ` David Gibson [this message]
2016-09-14  8:25 ` [Qemu-devel] [PATCH v5 2/3] memory: introduce IOMMUOps.notify_flag_changed Peter Xu
2016-09-20  6:13   ` David Gibson
2016-09-14  8:25 ` [Qemu-devel] [PATCH v5 3/3] intel_iommu: allow UNMAP notifiers Peter Xu
2016-09-20  6:14   ` David Gibson
2016-09-20  7:28     ` Peter Xu
2016-09-21  3:49       ` David Gibson
2016-09-21  4:57         ` Peter Xu
2016-09-19 12:47 ` [Qemu-devel] [PATCH v5 0/3] Introduce IOMMUNotifier struct Paolo Bonzini
2016-09-20  6:14   ` David Gibson

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=20160921034808.GW20488@umbus \
    --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 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).