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

Re: [Xen-devel] [PATCH v5 13/17] xen/arm: Use the typesafes mfn and gfn in map_dev_mmio_region...



On 28/06/16 17:17, Julien Grall wrote:
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index f11094e..5ffc3df 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1211,20 +1211,20 @@ int unmap_mmio_regions(struct domain *d,
>  }
>  
>  int map_dev_mmio_region(struct domain *d,
> -                        unsigned long start_gfn,
> +                        gfn_t gfn,
>                          unsigned long nr,
> -                        unsigned long mfn)
> +                        mfn_t mfn)
>  {
>      int res;
>  
> -    if ( !(nr && iomem_access_permitted(d, mfn, mfn + nr - 1)) )
> +    if ( !(nr && iomem_access_permitted(d, mfn_x(mfn), mfn_x(mfn) + nr - 1)) 
> )
>          return 0;
>  
> -    res = map_mmio_regions(d, _gfn(start_gfn), nr, _mfn(mfn));
> +    res = map_mmio_regions(d, gfn, nr, mfn);
>      if ( res < 0 )
>      {
>          printk(XENLOG_G_ERR "Unable to map [%#lx - %#lx] in Dom%d\n",

%PRImfn

I would also recommend qualifying what is being mapped, so "to map mfns
[...".

~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®.