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

Re: [Xen-devel] [PATCH v6 03/11] arch, arm: let map_mmio_regions() take pfn as parameters



On Mon, 2014-04-21 at 15:44 +0200, Arianna Avanzini wrote:
> Currently, the map_mmio_regions() function, defined for the ARM
> architecture, has parameters with paddr_t type. This interface,
> however, needs caller functions to correctly page-align addresses
> given as parameters to map_mmio_regions(). This commit changes the
> function's interface to accept page frame numbers as parameters.
> This commit also modifies caller functions in an attempt to adapt
> them to the new interface.
> This commit attempts to produce the minimum indispensable needed
> changes; these are also instrumental to making the interface of
> map_mmio_regions() symmetric with the unmap_mmio_regions() function,
> that will be introduced in one of the next commits of the series
> and will feature a pfn-based interface.
> 
> NOTE: platform-specific code has not been tested.
> 
> Signed-off-by: Arianna Avanzini <avanzini.arianna@xxxxxxxxx>
> Acked-by: Julien Grall <julien.grall@xxxxxxxxxx>
> Cc: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
> Cc: Paolo Valente <paolo.valente@xxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
> Cc: Jan Beulich <JBeulich@xxxxxxxx>
> Cc: Keir Fraser <keir@xxxxxxx>
> Cc: Tim Deegan <tim@xxxxxxx>
> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> Cc: Eric Trudeau <etrudeau@xxxxxxxxxxxx>
> Cc: Viktor Kleinik <viktor.kleinik@xxxxxxxxxxxxxxx>
> 
> ---
> 
>     v5:
>         - Add a macro for the paddr_to_pfn(PAGE_ALIGN(...)) pattern.
>         - Hopefully improve commit description.
> 
> ---
>  xen/arch/arm/domain_build.c          |  7 ++++---
>  xen/arch/arm/gic.c                   | 21 ++++++++++++---------
>  xen/arch/arm/p2m.c                   | 13 ++++++++-----
>  xen/arch/arm/platforms/exynos5.c     | 12 +++++++-----
>  xen/arch/arm/platforms/omap5.c       | 21 ++++++++++++---------
>  xen/arch/arm/platforms/xgene-storm.c |  4 +++-
>  xen/include/asm-arm/mm.h             |  2 ++
>  xen/include/asm-arm/p2m.h            | 11 ++++++-----
>  8 files changed, 54 insertions(+), 37 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 1802b6e..15db84b 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -751,9 +751,10 @@ static int map_device(struct domain *d, const struct 
> dt_device_node *dev)
>                     addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
>              return res;
>          }
> -        res = map_mmio_regions(d, addr & PAGE_MASK,
> -                               PAGE_ALIGN(addr + size) - 1,
> -                               addr & PAGE_MASK);
> +        res = map_mmio_regions(d,
> +                               paddr_to_pfn(addr & PAGE_MASK),
> +                               paddr_to_pfn_aligned(addr + size - 1),

Aren't all these -1's now redundant given the defintion of
paddr_to_pfn_aligned?

I think they are harmless in practice though:
         Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Ian.


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