From: Ian Campbell Subject: Re: [PATCH v3 09/13] xen/passthrough: Introduce IOMMU ARM architecture Date: Tue, 18 Mar 2014 16:40:26 +0000 Message-ID: <1395160826.11824.15.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPx43-0006Z0-V2 for xen-devel@lists.xenproject.org; Tue, 18 Mar 2014 16:40:32 +0000 In-Reply-To: <1394552999-14171-10-git-send-email-julien.grall@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-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? > 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. > + { > + rc = device_init(np, DEVICE_IOMMU, NULL); > + if ( !rc ) > + num_iommus++; > + } > + > + return ( num_iommus > 0 ) ? 0 : -ENODEV; > +} > + > +int arch_iommu_domain_init(struct domain *d) > +{ > + int ret; > + > + ret = iommu_dt_domain_init(d); > + > + return ret; return iommu_dt-domain_init(d); ? > 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? Ian.