From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes. Date: Fri, 3 Jul 2015 11:59:01 +0100 Message-ID: <1435921141.9447.85.camel@citrix.com> References: <1431084401.2660.440.camel@citrix.com> <1431084420-14372-5-git-send-email-ian.campbell@citrix.com> <558D9251.2070703@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <558D9251.2070703@citrix.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: Julien Grall Cc: julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2015-06-26 at 19:56 +0200, Julien Grall wrote: > Hi Ian, > > NIT in the title: The final point is not necessary > > On 08/05/2015 13:26, Ian Campbell wrote: > > +static int map_device_children(struct domain *d, > > + const struct dt_device_node *dev) > > +{ > > + bool_t need_mapping = !dt_device_for_passthrough(dev); > > + int ret; > > + > > + if ( dt_device_type_is_equal(dev, "pci") ) > > + { > > + DPRINT("Mapping children of %s to guest\n", dt_node_full_name(dev)); > > + > > + /* > > + * We need to handle IRQs even if !need_mapping in order to > > + * setup the domain's permissions on the device's IRQs, such > > + * that it can pass them through to other domains. > > + */ > > + ret = dt_for_each_irq_map(dev, &map_interrupt_to_domain, d); > > + if ( ret < 0 ) > > + return ret; > > + > > + if ( need_mapping ) > > + { > > I forgot to mention in the previous version that we need to give iomem > permission to the guest. Otherwise DOM0 won't be able to map the BAR > into the guest. This boils down to a call to iomem_permit_access in the map_range_to_domain callback and moving the need_mapping check down into the cb surrouding only the map_mmio_region call but not the permis_access one, right?