From: Ian Campbell Subject: Re: [PATCH v3 09/13] xen/passthrough: Introduce IOMMU ARM architecture Date: Wed, 19 Mar 2014 10:29:21 +0000 Message-ID: <1395224961.10203.40.camel@kazak.uk.xensource.com> References: <1394552999-14171-1-git-send-email-julien.grall@linaro.org> <1394552999-14171-10-git-send-email-julien.grall@linaro.org> <1395160826.11824.15.camel@kazak.uk.xensource.com> <5328A54E.9010502@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQDkd-0002ED-5Y for xen-devel@lists.xenproject.org; Wed, 19 Mar 2014 10:29:35 +0000 In-Reply-To: <5328A54E.9010502@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: Julien Grall Cc: xen-devel@lists.xenproject.org, Jan Beulich , tim@xen.org, Xiantao Zhang , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 2014-03-18 at 19:58 +0000, Julien Grall wrote: > Hi Ian, > > On 03/18/2014 04:40 PM, Ian Campbell wrote: > > On Tue, 2014-03-11 at 15:49 +0000, Julien Grall wrote: > >> @@ -754,7 +766,7 @@ static int map_device(struct domain *d, const struct dt_device_node *dev) > >> } > >> > >> static int handle_node(struct domain *d, struct kernel_info *kinfo, > >> - const struct dt_device_node *node) > >> + struct dt_device_node *node) > >> { > >> static const struct dt_device_match skip_matches[] __initconst = > >> { > >> @@ -775,7 +787,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, > >> DT_MATCH_TIMER, > >> { /* sentinel */ }, > >> }; > >> - const struct dt_device_node *child; > >> + struct dt_device_node *child; > > > > Why do these consts become unwanted? > > Because map_device now calls iommu_assign_dt_device which will update > next_assigned in the structure dt_device_node. OK, makes sense. > >> diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c > >> new file mode 100644 > >> index 0000000..b0bd71d > >> --- /dev/null > >> +++ b/xen/drivers/passthrough/arm/iommu.c > > [...] > >> +int __init iommu_hardware_setup(void) > >> +{ > >> + struct dt_device_node *np; > >> + int rc; > >> + unsigned int num_iommus = 0; > >> + > >> + dt_for_each_device_node(dt_host, np) > > > > I can't find dt_host in this or any of the previous patches. > > dt_host was defined a while ago by the device tree code (see > xen/include/xen/device_tree.h). Doh, I didn't think to look at the existing code ;-) > >> diff --git a/xen/include/asm-arm/iommu.h b/xen/include/asm-arm/iommu.h > >> new file mode 100644 > >> index 0000000..81eec83 > >> --- /dev/null > >> +++ b/xen/include/asm-arm/iommu.h > >> [...] > >> +#define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu) > > > > Does this macro give us the freedom to avoid the term "hvm" a bit and > > use d->arch.iommu? > > It's possible, I just blindly copied from x86. Ian.