From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH v2 1/3] arch, arm: allow dom0 access to I/O memory of mapped devices Date: Thu, 13 Mar 2014 15:40:31 +0000 Message-ID: <5321D16F.1040809@linaro.org> References: <1394439953-5723-1-git-send-email-avanzini.arianna@gmail.com> <1394439953-5723-2-git-send-email-avanzini.arianna@gmail.com> <1394724454.25873.102.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394724454.25873.102.camel@kazak.uk.xensource.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: Ian Campbell Cc: paolo.valente@unimore.it, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, Arianna Avanzini , viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 03/13/2014 03:27 PM, Ian Campbell wrote: >> @@ -733,6 +734,15 @@ static int map_device(struct domain *d, const struct dt_device_node *dev) >> DPRINT("addr %u = 0x%"PRIx64" - 0x%"PRIx64"\n", >> i, addr, addr + size - 1); >> >> + res = iomem_permit_access(d, paddr_to_pfn(addr & PAGE_MASK), >> + paddr_to_pfn(PAGE_ALIGN(addr + size - 1))); >> + if ( res ) >> + { >> + printk(XENLOG_ERR "Unable to permit to dom0 access to" >> + " 0x%"PRIx64" - 0x%"PRIx64"\n", >> + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1); > > Not your fault but I wonder why we are using u64 here for addr and > friends and not paddr_t. dt_device_get_address is taken 2 pointers to u64 (e.g address and size) in parameter. It was copy from Linux DT code. I can send a patch to replace u64 by paddr_t for these calls. Regards, -- Julien Grall