From: Julien Grall Subject: [PATCH v2 07/15] xen/passthrough: iommu: Don't need to map dom0 page when the PT is shared Date: Sun, 23 Feb 2014 22:16:24 +0000 Message-ID: <1393193792-20008-8-git-send-email-julien.grall@linaro.org> References: <1393193792-20008-1-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 1WHhLs-0006qb-EV for xen-devel@lists.xenproject.org; Sun, 23 Feb 2014 22:16:48 +0000 Received: by mail-ee0-f49.google.com with SMTP id d17so2747429eek.8 for ; Sun, 23 Feb 2014 14:16:46 -0800 (PST) In-Reply-To: <1393193792-20008-1-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: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com, Xiantao Zhang List-Id: xen-devel@lists.xenproject.org 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 Acked-by: Ian Campbell Acked-by: Jan Beulich Cc: Xiantao Zhang --- 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 b534893..3c63f87 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -156,7 +156,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; -- 1.7.10.4