diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c index 31dc05d920..495ff5c831 100644 --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -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)); diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 7fcbbb1f86..92ea26f8b4 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -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); } diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 48676c5b53..891b9e302f 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -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)); }