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: Mon, 10 Mar 2014 11:30:54 +0000 Message-ID: <531DA26E.6040508@linaro.org> References: <1394439953-5723-1-git-send-email-avanzini.arianna@gmail.com> <1394439953-5723-2-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: <1394439953-5723-2-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, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, Ian.Campbell@eu.citrix.com, etrudeau@broadcom.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org Hello Arianna, On 03/10/2014 08:25 AM, Arianna Avanzini wrote: > Currently, dom0 is not allowed access to the I/O memory ranges > used to access devices exposed to it. This commit attempts > to give it access to those memory ranges during domain build > by adding the ranges to dom0's iomem_caps. > > Signed-off-by: Arianna Avanzini > Cc: Dario Faggioli > Cc: Paolo Valente > Cc: Stefano Stabellini > Cc: Julien Grall > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Eric Trudeau > Cc: Viktor Kleinik > --- > xen/arch/arm/domain_build.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index 5ca2f15..0b283d8 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -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" Can you print the right domain id instead of using "dom0"? I have a patch to remove the other hardcoded "dom0" in this function. Regards, -- Julien Grall