iommu: don't need to map dom0 page when the PT is shared
authorJulien Grall <julien.grall@linaro.org>
Mon, 24 Feb 2014 11:33:00 +0000 (12:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 24 Feb 2014 11:33:00 +0000 (12:33 +0100)
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 <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/iommu.c

index 19b0e23feb278f875a30a819e3ed5d30307df09a..c70165a44ae14526c70cdcd8f8c488c7d148c608 100644 (file)
@@ -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;