From: Ian Campbell Subject: Re: [PATCH v6 03/11] arch, arm: let map_mmio_regions() take pfn as parameters Date: Mon, 28 Apr 2014 14:13:19 +0100 Message-ID: <1398690799.29700.88.camel@kazak.uk.xensource.com> References: <1398087904-16594-1-git-send-email-avanzini.arianna@gmail.com> <1398087904-16594-4-git-send-email-avanzini.arianna@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1398087904-16594-4-git-send-email-avanzini.arianna@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Arianna Avanzini Cc: paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, dario.faggioli@citrix.com, tim@xen.org, xen-devel@lists.xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, JBeulich@suse.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org 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 > Acked-by: Julien Grall > Cc: Dario Faggioli > Cc: Paolo Valente > Cc: Stefano Stabellini > Cc: Ian Campbell > Cc: Jan Beulich > Cc: Keir Fraser > Cc: Tim Deegan > Cc: Ian Jackson > Cc: Eric Trudeau > Cc: Viktor Kleinik > > --- > > 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.