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, tianyu.lan@intel.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	kevin.tian@intel.com, yi.l.liu@intel.com,
	Jason Wang <jasowang@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 5/8] memory: rename *iommu_notifier*
Date: Mon, 1 May 2017 14:56:24 +1000	[thread overview]
Message-ID: <20170501045624.GL13773@umbus.fritz.box> (raw)
In-Reply-To: <1493285660-4470-6-git-send-email-peterx@redhat.com>

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

On Thu, Apr 27, 2017 at 05:34:17PM +0800, Peter Xu wrote:
> Renaming *iommu_notifiers* into *iotlb_notifiers*. Again, let's reserve
> the iommu_notifier keyword to the notifiers that will be for per-iommu,
> and let the old per-mr notifier be iotlb_notifiers.

As with the previous patch, I really don't see that "iotlb" is an
clearer than "iommu" here.  This is notifying of changes in mapping on
an IOMMU region.  There may or may not be an IOTLB of some sort
involved.


> 
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  hw/vfio/common.c      |  6 +++---
>  hw/virtio/vhost.c     |  4 ++--
>  include/exec/memory.h |  8 ++++----
>  memory.c              | 20 ++++++++++----------
>  4 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 6b3953b..7b639ea 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -487,7 +487,7 @@ static void vfio_listener_region_add(MemoryListener *listener,
>                                 int128_get64(llend));
>          QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next);
>  
> -        memory_region_register_iommu_notifier(giommu->iommu, &giommu->n);
> +        memory_region_register_iotlb_notifier(giommu->iommu, &giommu->n);
>          memory_region_iommu_replay(giommu->iommu, &giommu->n, false);
>  
>          return;
> @@ -557,7 +557,7 @@ static void vfio_listener_region_del(MemoryListener *listener,
>          QLIST_FOREACH(giommu, &container->giommu_list, giommu_next) {
>              if (giommu->iommu == section->mr &&
>                  giommu->n.start == section->offset_within_region) {
> -                memory_region_unregister_iommu_notifier(giommu->iommu,
> +                memory_region_unregister_iotlb_notifier(giommu->iommu,
>                                                          &giommu->n);
>                  QLIST_REMOVE(giommu, giommu_next);
>                  g_free(giommu);
> @@ -1147,7 +1147,7 @@ static void vfio_disconnect_container(VFIOGroup *group)
>          QLIST_REMOVE(container, next);
>  
>          QLIST_FOREACH_SAFE(giommu, &container->giommu_list, giommu_next, tmp) {
> -            memory_region_unregister_iommu_notifier(giommu->iommu, &giommu->n);
> +            memory_region_unregister_iotlb_notifier(giommu->iommu, &giommu->n);
>              QLIST_REMOVE(giommu, giommu_next);
>              g_free(giommu);
>          }
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 7449cf8..a1e03ed 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -754,7 +754,7 @@ static void vhost_iommu_region_add(MemoryListener *listener,
>      iommu->iommu_offset = section->offset_within_address_space -
>                            section->offset_within_region;
>      iommu->hdev = dev;
> -    memory_region_register_iommu_notifier(section->mr, &iommu->n);
> +    memory_region_register_iotlb_notifier(section->mr, &iommu->n);
>      QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next);
>      /* TODO: can replay help performance here? */
>  }
> @@ -773,7 +773,7 @@ static void vhost_iommu_region_del(MemoryListener *listener,
>      QLIST_FOREACH(iommu, &dev->iommu_list, iommu_next) {
>          if (iommu->mr == section->mr &&
>              iommu->n.start == section->offset_within_region) {
> -            memory_region_unregister_iommu_notifier(iommu->mr,
> +            memory_region_unregister_iotlb_notifier(iommu->mr,
>                                                      &iommu->n);
>              QLIST_REMOVE(iommu, iommu_next);
>              g_free(iommu);
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 09188a6..e5707b3 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -708,7 +708,7 @@ void memory_region_notify_iotlb_one(IOMMUMRNotifier *notifier,
>                                      IOMMUTLBEntry *entry);
>  
>  /**
> - * memory_region_register_iommu_notifier: register a notifier for changes to
> + * memory_region_register_iotlb_notifier: register a notifier for changes to
>   * IOMMU translation entries.
>   *
>   * @mr: the memory region to observe
> @@ -716,7 +716,7 @@ void memory_region_notify_iotlb_one(IOMMUMRNotifier *notifier,
>   *     pointer to an #IOMMUTLBEntry as the opaque value; the pointer
>   *     ceases to be valid on exit from the notifier.
>   */
> -void memory_region_register_iommu_notifier(MemoryRegion *mr,
> +void memory_region_register_iotlb_notifier(MemoryRegion *mr,
>                                             IOMMUMRNotifier *n);
>  
>  /**
> @@ -741,14 +741,14 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUMRNotifier *n,
>  void memory_region_iommu_replay_all(MemoryRegion *mr);
>  
>  /**
> - * memory_region_unregister_iommu_notifier: unregister a notifier for
> + * memory_region_unregister_iotlb_notifier: unregister a notifier for
>   * changes to IOMMU translation entries.
>   *
>   * @mr: the memory region which was observed and for which notity_stopped()
>   *      needs to be called
>   * @n: the notifier to be removed.
>   */
> -void memory_region_unregister_iommu_notifier(MemoryRegion *mr,
> +void memory_region_unregister_iotlb_notifier(MemoryRegion *mr,
>                                               IOMMUMRNotifier *n);
>  
>  /**
> diff --git a/memory.c b/memory.c
> index c6532e4..6af523e 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1581,10 +1581,10 @@ bool memory_region_is_logging(MemoryRegion *mr, uint8_t client)
>  static void memory_region_update_iommu_notify_flags(MemoryRegion *mr)
>  {
>      IOMMUMREventFlags flags = IOMMU_MR_EVENT_NONE;
> -    IOMMUMRNotifier *iommu_notifier;
> +    IOMMUMRNotifier *iotlb_notifier;
>  
> -    IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) {
> -        flags |= iommu_notifier->notifier_flags;
> +    IOMMU_NOTIFIER_FOREACH(iotlb_notifier, mr) {
> +        flags |= iotlb_notifier->notifier_flags;
>      }
>  
>      if (flags != mr->iommu_notify_flags &&
> @@ -1596,11 +1596,11 @@ static void memory_region_update_iommu_notify_flags(MemoryRegion *mr)
>      mr->iommu_notify_flags = flags;
>  }
>  
> -void memory_region_register_iommu_notifier(MemoryRegion *mr,
> +void memory_region_register_iotlb_notifier(MemoryRegion *mr,
>                                             IOMMUMRNotifier *n)
>  {
>      if (mr->alias) {
> -        memory_region_register_iommu_notifier(mr->alias, n);
> +        memory_region_register_iotlb_notifier(mr->alias, n);
>          return;
>      }
>  
> @@ -1657,11 +1657,11 @@ void memory_region_iommu_replay_all(MemoryRegion *mr)
>      }
>  }
>  
> -void memory_region_unregister_iommu_notifier(MemoryRegion *mr,
> +void memory_region_unregister_iotlb_notifier(MemoryRegion *mr,
>                                               IOMMUMRNotifier *n)
>  {
>      if (mr->alias) {
> -        memory_region_unregister_iommu_notifier(mr->alias, n);
> +        memory_region_unregister_iotlb_notifier(mr->alias, n);
>          return;
>      }
>      QLIST_REMOVE(n, node);
> @@ -1696,12 +1696,12 @@ void memory_region_notify_iotlb_one(IOMMUMRNotifier *notifier,
>  void memory_region_notify_iotlb(MemoryRegion *mr,
>                                  IOMMUTLBEntry entry)
>  {
> -    IOMMUMRNotifier *iommu_notifier;
> +    IOMMUMRNotifier *iotlb_notifier;
>  
>      assert(memory_region_is_iommu(mr));
>  
> -    IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) {
> -        memory_region_notify_iotlb_one(iommu_notifier, &entry);
> +    IOMMU_NOTIFIER_FOREACH(iotlb_notifier, mr) {
> +        memory_region_notify_iotlb_one(iotlb_notifier, &entry);
>      }
>  }
>  

-- 
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:[~2017-05-01  5:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  9:34 [Qemu-devel] [RFC PATCH 0/8] IOMMU: introduce common IOMMUObject Peter Xu
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 1/8] memory: rename IOMMU_NOTIFIER_* Peter Xu
2017-05-01  4:50   ` David Gibson
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 2/8] memory: rename IOMMUNotifier Peter Xu
2017-05-01  4:51   ` David Gibson
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 3/8] memory: rename iommu_notifier_init() Peter Xu
2017-05-01  4:53   ` David Gibson
2017-05-08  5:50     ` Peter Xu
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 4/8] memory: rename *_notify_iommu* Peter Xu
2017-05-01  4:55   ` David Gibson
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 5/8] memory: rename *iommu_notifier* Peter Xu
2017-05-01  4:56   ` David Gibson [this message]
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 6/8] memory: introduce AddressSpaceOps Peter Xu
2017-05-01  4:58   ` David Gibson
2017-05-08  5:48     ` Peter Xu
2017-05-08  6:07       ` David Gibson
2017-05-08  7:32         ` Peter Xu
2017-05-07  9:44           ` Liu, Yi L
2017-05-10  7:04           ` David Gibson
2017-05-11  5:04             ` Peter Xu
2017-05-15  5:32               ` David Gibson
2017-05-25  7:24                 ` Peter Xu
2017-05-26  5:30                   ` David Gibson
2017-06-08  8:24                     ` Liu, Yi L
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 7/8] intel_iommu: provide AddressSpaceOps.iommu_get() Peter Xu
2017-04-27  9:34 ` [Qemu-devel] [RFC PATCH 8/8] iommu: introduce hw/core/iommu Peter Xu
2017-04-28 10:01   ` Liu, Yi L
2017-04-28 10:34     ` Peter Xu
2017-06-07  7:51   ` Liu, Yi L
2017-06-07  8:28     ` Peter Xu

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=20170501045624.GL13773@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kevin.tian@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tianyu.lan@intel.com \
    --cc=yi.l.liu@intel.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).