From: Julien Grall Date: Mon, 24 Feb 2014 11:33:00 +0000 (+0100) Subject: iommu: don't need to map dom0 page when the PT is shared X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5555 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b51591c330672765d866a5ed4ed8e40c75bb1cf;p=xen.git iommu: don't need to map dom0 page when the PT is shared 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 --- diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 19b0e23feb..c70165a44a 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -153,7 +153,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;