[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 8/8] xen/arm: p2m_cache_flush: Use the correct terminology and typesafe gfn



On 14/06/16 13:07, Julien Grall wrote:
> p2m_cache_flush is expecting GFNs in parameter and not MFNs. Rename
> the variable to *gfn* and use typesafe to avoid possible misusage.
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
> ---
>  xen/arch/arm/domctl.c     |  2 +-
>  xen/arch/arm/p2m.c        | 10 +++++-----
>  xen/include/asm-arm/p2m.h |  2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
> index 30453d8..b94e97c 100644
> --- a/xen/arch/arm/domctl.c
> +++ b/xen/arch/arm/domctl.c
> @@ -30,7 +30,7 @@ long arch_do_domctl(struct xen_domctl *domctl, struct 
> domain *d,
>          if ( e < s )
>              return -EINVAL;
>  
> -        return p2m_cache_flush(d, s, e);
> +        return p2m_cache_flush(d, _gfn(s), _gfn(e));
>      }
>      case XEN_DOMCTL_bind_pt_irq:
>      {
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 135d032..d50eda3 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1467,16 +1467,16 @@ int relinquish_p2m_mapping(struct domain *d)
>                                d->arch.p2m.default_access);
>  }
>  
> -int p2m_cache_flush(struct domain *d, xen_pfn_t start_mfn, xen_pfn_t end_mfn)
> +int p2m_cache_flush(struct domain *d, gfn_t start_gfn, gfn_t end_gfn)

I would recommend dropping the _gfn suffix from start and end.  It only
serves to make the code longer, as the numbers are of gfn_t type.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.