From: "Jan Beulich" Subject: Re: [PATCH v4 21/33] xen/passthrough: Introduce iommu_construct Date: Fri, 20 Mar 2015 10:53:25 +0000 Message-ID: <550C0A35020000780006BF33@mail.emea.novell.com> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> <1426793399-6283-22-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYuYS-0002qd-BJ for xen-devel@lists.xenproject.org; Fri, 20 Mar 2015 10:53:28 +0000 In-Reply-To: <1426793399-6283-22-git-send-email-julien.grall@linaro.org> Content-Disposition: inline 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, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 19.03.15 at 20:29, wrote: > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -187,6 +187,32 @@ void iommu_teardown(struct domain *d) > tasklet_schedule(&iommu_pt_cleanup_tasklet); > } > > +int iommu_construct(struct domain *d) > +{ > + int rc = 0; > + > + if ( need_iommu(d) > 0 ) > + return 0; > + > + if ( !iommu_use_hap_pt(d) ) > + { > + rc = arch_iommu_populate_page_table(d); > + if ( rc ) > + return rc; > + } Please limit the scope of rc to the body of this if(). With that Acked-by: Jan Beulich