diff mbox

[RFC,3/8] memory: rename iommu_notifier_init()

Message ID 1493285660-4470-4-git-send-email-peterx@redhat.com
State New
Headers show

Commit Message

Peter Xu April 27, 2017, 9:34 a.m. UTC
It's new name is iommu_mr_notifier_init(). Again, literal changes only.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/vfio/common.c      | 8 ++++----
 hw/virtio/vhost.c     | 8 ++++----
 include/exec/memory.h | 7 ++++---
 3 files changed, 12 insertions(+), 11 deletions(-)

Comments

David Gibson May 1, 2017, 4:53 a.m. UTC | #1
On Thu, Apr 27, 2017 at 05:34:15PM +0800, Peter Xu wrote:
> It's new name is iommu_mr_notifier_init(). Again, literal changes only.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>

Again, I think this could be folded with the previous two patches.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

I also note that these patches will conflict with Alexey's proposed
changes to make IOMMU MR's a QOM subtype of the ordinary MR (thus
removing some of the MR specific fields from other MRs.

> ---
>  hw/vfio/common.c      | 8 ++++----
>  hw/virtio/vhost.c     | 8 ++++----
>  include/exec/memory.h | 7 ++++---
>  3 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index bd113b7..6b3953b 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -481,10 +481,10 @@ static void vfio_listener_region_add(MemoryListener *listener,
>          llend = int128_add(int128_make64(section->offset_within_region),
>                             section->size);
>          llend = int128_sub(llend, int128_one());
> -        iommu_notifier_init(&giommu->n, vfio_iommu_map_notify,
> -                            IOMMU_MR_EVENT_ALL,
> -                            section->offset_within_region,
> -                            int128_get64(llend));
> +        iommu_mr_notifier_init(&giommu->n, vfio_iommu_map_notify,
> +                               IOMMU_MR_EVENT_ALL,
> +                               section->offset_within_region,
> +                               int128_get64(llend));
>          QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next);
>  
>          memory_region_register_iommu_notifier(giommu->iommu, &giommu->n);
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 81a8aea..7449cf8 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -746,10 +746,10 @@ static void vhost_iommu_region_add(MemoryListener *listener,
>      end = int128_add(int128_make64(section->offset_within_region),
>                       section->size);
>      end = int128_sub(end, int128_one());
> -    iommu_notifier_init(&iommu->n, vhost_iommu_unmap_notify,
> -                        IOMMU_MR_EVENT_UNMAP,
> -                        section->offset_within_region,
> -                        int128_get64(end));
> +    iommu_mr_notifier_init(&iommu->n, vhost_iommu_unmap_notify,
> +                           IOMMU_MR_EVENT_UNMAP,
> +                           section->offset_within_region,
> +                           int128_get64(end));
>      iommu->mr = section->mr;
>      iommu->iommu_offset = section->offset_within_address_space -
>                            section->offset_within_region;
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 6be0c02..8d8dcb2 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -93,9 +93,10 @@ struct IOMMUMRNotifier {
>  };
>  typedef struct IOMMUMRNotifier IOMMUMRNotifier;
>  
> -static inline void iommu_notifier_init(IOMMUMRNotifier *n, IOMMUNotify fn,
> -                                       IOMMUMREventFlags flags,
> -                                       hwaddr start, hwaddr end)
> +static inline void iommu_mr_notifier_init(IOMMUMRNotifier *n,
> +                                          IOMMUNotify fn,
> +                                          IOMMUMREventFlags flags,
> +                                          hwaddr start, hwaddr end)
>  {
>      n->notify = fn;
>      n->notifier_flags = flags;
Peter Xu May 8, 2017, 5:50 a.m. UTC | #2
On Mon, May 01, 2017 at 02:53:35PM +1000, David Gibson wrote:
> On Thu, Apr 27, 2017 at 05:34:15PM +0800, Peter Xu wrote:
> > It's new name is iommu_mr_notifier_init(). Again, literal changes only.
> > 
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> 
> Again, I think this could be folded with the previous two patches.

Sure. I can squash them all after I know whether we'll need this
series.

> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> 
> I also note that these patches will conflict with Alexey's proposed
> changes to make IOMMU MR's a QOM subtype of the ordinary MR (thus
> removing some of the MR specific fields from other MRs.

No problem. Due to some reason I just came back to read all the mails,
so haven't read them yet. I can rebase when needed. Thanks,
diff mbox

Patch

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index bd113b7..6b3953b 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -481,10 +481,10 @@  static void vfio_listener_region_add(MemoryListener *listener,
         llend = int128_add(int128_make64(section->offset_within_region),
                            section->size);
         llend = int128_sub(llend, int128_one());
-        iommu_notifier_init(&giommu->n, vfio_iommu_map_notify,
-                            IOMMU_MR_EVENT_ALL,
-                            section->offset_within_region,
-                            int128_get64(llend));
+        iommu_mr_notifier_init(&giommu->n, vfio_iommu_map_notify,
+                               IOMMU_MR_EVENT_ALL,
+                               section->offset_within_region,
+                               int128_get64(llend));
         QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next);
 
         memory_region_register_iommu_notifier(giommu->iommu, &giommu->n);
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 81a8aea..7449cf8 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -746,10 +746,10 @@  static void vhost_iommu_region_add(MemoryListener *listener,
     end = int128_add(int128_make64(section->offset_within_region),
                      section->size);
     end = int128_sub(end, int128_one());
-    iommu_notifier_init(&iommu->n, vhost_iommu_unmap_notify,
-                        IOMMU_MR_EVENT_UNMAP,
-                        section->offset_within_region,
-                        int128_get64(end));
+    iommu_mr_notifier_init(&iommu->n, vhost_iommu_unmap_notify,
+                           IOMMU_MR_EVENT_UNMAP,
+                           section->offset_within_region,
+                           int128_get64(end));
     iommu->mr = section->mr;
     iommu->iommu_offset = section->offset_within_address_space -
                           section->offset_within_region;
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 6be0c02..8d8dcb2 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -93,9 +93,10 @@  struct IOMMUMRNotifier {
 };
 typedef struct IOMMUMRNotifier IOMMUMRNotifier;
 
-static inline void iommu_notifier_init(IOMMUMRNotifier *n, IOMMUNotify fn,
-                                       IOMMUMREventFlags flags,
-                                       hwaddr start, hwaddr end)
+static inline void iommu_mr_notifier_init(IOMMUMRNotifier *n,
+                                          IOMMUNotify fn,
+                                          IOMMUMREventFlags flags,
+                                          hwaddr start, hwaddr end)
 {
     n->notify = fn;
     n->notifier_flags = flags;