From: Ian Campbell Subject: Re: [RFC for-4.5 07/12] xen/passthrough: iommu: Don't need to map dom0 page when the PT is shared Date: Wed, 19 Feb 2014 12:37:10 +0000 Message-ID: <1392813430.29739.44.camel@kazak.uk.xensource.com> References: <1391794991-5919-1-git-send-email-julien.grall@linaro.org> <1391794991-5919-8-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 1WG6Op-0000dJ-AV for xen-devel@lists.xenproject.org; Wed, 19 Feb 2014 12:37:15 +0000 In-Reply-To: <1391794991-5919-8-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: patches@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org, Xiantao Zhang List-Id: xen-devel@lists.xenproject.org On Fri, 2014-02-07 at 17:43 +0000, Julien Grall wrote: > Currently iommu_init_dom0 is browsing the page list and call map_page callback > on each page. > > On both AMD and VTD drivers, the function will directly return if the page > table is shared with the processor. So Xen can safely avoid to run through > the page list. > > Signed-off-by: Julien Grall > Cc: Xiantao Zhang > Cc: Jan Beulich Acked-by: Ian Campbell > --- > xen/drivers/passthrough/iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c > index 26a5d91..0a26956 100644 > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -157,7 +157,7 @@ void __init iommu_dom0_init(struct domain *d) > > register_keyhandler('o', &iommu_p2m_table); > d->need_iommu = !!iommu_dom0_strict; > - if ( need_iommu(d) ) > + if ( need_iommu(d) && !iommu_use_hap_pt(d) ) > { > struct page_info *page; > unsigned int i = 0;