diff mbox

[v3,5/8] xen/arm: Rename grant_table_gfpn into grant_table_gfn and use the typesafe gfn

Message ID 1466515243-27264-6-git-send-email-julien.grall@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Julien Grall June 21, 2016, 1:20 p.m. UTC
The correct acronym for a guest physical frame is gfn. Also use
the typesafe gfn to ensure that a guest frame is effectively used.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    Changes in v2:
        - Remove extra pair of brackets.
---
 xen/arch/arm/domain.c             | 4 ++--
 xen/arch/arm/mm.c                 | 2 +-
 xen/include/asm-arm/domain.h      | 2 +-
 xen/include/asm-arm/grant_table.h | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

Comments

Stefano Stabellini June 23, 2016, 2 p.m. UTC | #1
On Tue, 21 Jun 2016, Julien Grall wrote:
> The correct acronym for a guest physical frame is gfn. Also use
> the typesafe gfn to ensure that a guest frame is effectively used.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>     Changes in v2:
>         - Remove extra pair of brackets.
> ---
>  xen/arch/arm/domain.c             | 4 ++--
>  xen/arch/arm/mm.c                 | 2 +-
>  xen/include/asm-arm/domain.h      | 2 +-
>  xen/include/asm-arm/grant_table.h | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index d8a804c..6ce4645 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -464,13 +464,13 @@ struct domain *alloc_domain_struct(void)
>          return NULL;
>  
>      clear_page(d);
> -    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames);
> +    d->arch.grant_table_gfn = xzalloc_array(gfn_t, max_grant_frames);
>      return d;
>  }
>  
>  void free_domain_struct(struct domain *d)
>  {
> -    xfree(d->arch.grant_table_gpfn);
> +    xfree(d->arch.grant_table_gfn);
>      free_xenheap_page(d);
>  }
>  
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 6882d54..0e408f8 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -1082,7 +1082,7 @@ int xenmem_add_to_physmap_one(
>                  return -EINVAL;
>          }
>  
> -        d->arch.grant_table_gpfn[idx] = gfn_x(gfn);
> +        d->arch.grant_table_gfn[idx] = gfn;
>  
>          t = p2m_ram_rw;
>  
> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
> index 370cdeb..979f7de 100644
> --- a/xen/include/asm-arm/domain.h
> +++ b/xen/include/asm-arm/domain.h
> @@ -51,7 +51,7 @@ struct arch_domain
>      uint64_t vttbr;
>  
>      struct hvm_domain hvm_domain;
> -    xen_pfn_t *grant_table_gpfn;
> +    gfn_t *grant_table_gfn;
>  
>      struct vmmio vmmio;
>  
> diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
> index 5e076cc..eb02423 100644
> --- a/xen/include/asm-arm/grant_table.h
> +++ b/xen/include/asm-arm/grant_table.h
> @@ -30,7 +30,7 @@ static inline int replace_grant_supported(void)
>  
>  #define gnttab_shared_gmfn(d, t, i)                                      \
>      ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
> -     (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
> +     (i < max_grant_frames)) ? 0 : gfn_x(d->arch.grant_table_gfn[i]))
>  
>  #define gnttab_need_iommu_mapping(d)                    \
>      (is_domain_direct_mapped(d) && need_iommu(d))
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index d8a804c..6ce4645 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -464,13 +464,13 @@  struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames);
+    d->arch.grant_table_gfn = xzalloc_array(gfn_t, max_grant_frames);
     return d;
 }
 
 void free_domain_struct(struct domain *d)
 {
-    xfree(d->arch.grant_table_gpfn);
+    xfree(d->arch.grant_table_gfn);
     free_xenheap_page(d);
 }
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6882d54..0e408f8 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1082,7 +1082,7 @@  int xenmem_add_to_physmap_one(
                 return -EINVAL;
         }
 
-        d->arch.grant_table_gpfn[idx] = gfn_x(gfn);
+        d->arch.grant_table_gfn[idx] = gfn;
 
         t = p2m_ram_rw;
 
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 370cdeb..979f7de 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -51,7 +51,7 @@  struct arch_domain
     uint64_t vttbr;
 
     struct hvm_domain hvm_domain;
-    xen_pfn_t *grant_table_gpfn;
+    gfn_t *grant_table_gfn;
 
     struct vmmio vmmio;
 
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 5e076cc..eb02423 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -30,7 +30,7 @@  static inline int replace_grant_supported(void)
 
 #define gnttab_shared_gmfn(d, t, i)                                      \
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
-     (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
+     (i < max_grant_frames)) ? 0 : gfn_x(d->arch.grant_table_gfn[i]))
 
 #define gnttab_need_iommu_mapping(d)                    \
     (is_domain_direct_mapped(d) && need_iommu(d))