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>
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));
{
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);
}
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));
}