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

Re: [Xen-devel] [PATCH v7 04/10] arch/arm: let map_mmio_regions() use start and count



On 05/05/2014 04:54 PM, Arianna Avanzini wrote:
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index f88cddc..2c7f542 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -511,12 +511,12 @@ int p2m_populate_ram(struct domain *d,
>  
>  int map_mmio_regions(struct domain *d,
>                       unsigned long start_gfn,
> -                     unsigned long end_gfn,
> +                     unsigned long nr_mfns,
>                       unsigned long mfn)
>  {
>      return apply_p2m_changes(d, INSERT,
>                               pfn_to_paddr(start_gfn),
> -                             pfn_to_paddr(end_gfn),
> +                             pfn_to_paddr(start_gfn + nr_mfns + 1),

This is wrong, apply_p2m_changes range is [spfn, epfn[. Here you will
map one page more. This remark is also valid for unmap_mmio_regions in
patch #7.

Once you're series will be pushed in Xen upstream, I plan to rework
apply_p2m_changes to use gfn + nr_pages which is less confusing and
avoid using non aligned address as arguments (actually the function is
assuming that the address is page-aligned).

Regards,

-- 
Julien Grall

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