]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
passthrough: share_p2m: fix build failure on ARM
authorJulien Grall <julien.grall@linaro.org>
Wed, 11 Mar 2015 13:05:25 +0000 (14:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Mar 2015 13:05:25 +0000 (14:05 +0100)
The commit 7978429 "iommu: fix usage of shared EPT/IOMMU page tables on
PVH guests" breaks the hypervisor compilation on ARM.

This is because the macro hap_enabled is not defined on ARM.

On x86, the P2M can only be shared when hap is enabled and the user
didn't deny it (via the command line). Those checks are done by
iommu_use_hap_pt().

On ARM, the macro iommu_use_hap_pt() is also defined. So move the
if ( iommu_use_hap_pt(d) ) from the IOMMU drivers up to
iommu_share_p2m_table.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/iommu.c

index 31dc05d92087ab1931cede44b7f30615884dfdc6..495ff5c83103dd0eaea12a1b60f6d150fd144bb0 100644 (file)
@@ -785,9 +785,6 @@ void amd_iommu_share_p2m(struct domain *d)
     struct page_info *p2m_table;
     mfn_t pgd_mfn;
 
-    if ( !iommu_use_hap_pt(d) )
-        return;
-
     pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)));
     p2m_table = mfn_to_page(mfn_x(pgd_mfn));
 
index 7fcbbb1f86363b775565833e0aac64aef214ab1a..92ea26f8b49c60f3cdfcf57adaaa83380900e745 100644 (file)
@@ -332,8 +332,7 @@ void iommu_share_p2m_table(struct domain* d)
 {
     const struct iommu_ops *ops = iommu_get_ops();
 
-    ASSERT( hap_enabled(d) );
-    if ( iommu_enabled )
+    if ( iommu_enabled && iommu_use_hap_pt(d) )
         ops->share_p2m(d);
 }
 
index 48676c5b5359af77eb51a19a7d3c3a02ceaa8025..891b9e302f4d1f7a1e0407325551f1de6970d62c 100644 (file)
@@ -1789,9 +1789,6 @@ static void iommu_set_pgd(struct domain *d)
     struct hvm_iommu *hd  = domain_hvm_iommu(d);
     mfn_t pgd_mfn;
 
-    if ( !iommu_use_hap_pt(d) )
-        return;
-
     pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)));
     hd->arch.pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn));
 }