From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH RFC 27/35] arm: acpi map mmio regions to dom0 Date: Wed, 11 Feb 2015 17:26:42 +0800 Message-ID: <54DB2052.3090608@linaro.org> References: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> <1423058539-26403-28-git-send-email-parth.dixit@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1423058539-26403-28-git-send-email-parth.dixit@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: parth.dixit@linaro.org, xen-devel@lists.xen.org Cc: christoffer.dall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org Hi Parth, On 04/02/2015 22:02, parth.dixit@linaro.org wrote: > From: Parth Dixit > > map mmio regions described in uefi tables to dom0 address space > > Signed-off-by: Parth Dixit > --- > xen/arch/arm/domain_build.c | 54 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index d781c63..49eb52a 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -1235,6 +1235,56 @@ static int make_chosen_node(const struct domain *d, const struct kernel_info *ki > return res; > } > > +static int acpi_map_mmio(struct domain *d) > +{ > + int i,res; > + u64 addr,size; Missing space after the comma. > + > + for( i = 0; i < acpi_mmio.nr_banks; i++ ) > + { > + addr = acpi_mmio.bank[i].start; > + size = acpi_mmio.bank[i].size; > + > + res = iomem_permit_access(d, paddr_to_pfn(addr & PAGE_MASK), There is multiple place within this loop which use paddr_to_pfn(addr & PAGE_MASK). I would create a temporary variable to store the value and use it everywhere. > + paddr_to_pfn(PAGE_ALIGN(addr + size - 1))); The indentation is wrong. > + if ( res ) > + { > + printk(XENLOG_ERR "Unable to permit to dom%d access to" > + " 0x%"PRIx64" - 0x%"PRIx64"\n", > + d->domain_id, > + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1); > + return res; > + } > + > + res = map_mmio_regions(d, > + paddr_to_pfn(addr & PAGE_MASK), > + DIV_ROUND_UP(size, PAGE_SIZE), > + paddr_to_pfn(addr & PAGE_MASK)); Ditto Regards, -- Julien Grall