diff --git a/xen/drivers/passthrough/arm/iommu_helpers.c b/xen/drivers/passthrough/arm/iommu_helpers.c index 5cb1987481..bdb271584b 100644 --- a/xen/drivers/passthrough/arm/iommu_helpers.c +++ b/xen/drivers/passthrough/arm/iommu_helpers.c @@ -36,15 +36,7 @@ int __must_check arm_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn, { p2m_type_t t; - /* - * Grant mappings can be used for DMA requests. The dev_bus_addr - * returned by the hypercall is the MFN (not the IPA). For device - * protected by an IOMMU, Xen needs to add a 1:1 mapping in the domain - * p2m to allow DMA request to work. - * This is only valid when the domain is directed mapped. Hence this - * function should only be used by gnttab code with gfn == mfn == dfn. - */ - BUG_ON(!is_domain_direct_mapped(d)); + BUG_ON(!domain_use_host_layout(d)); BUG_ON(mfn_x(mfn) != dfn_x(dfn)); /* We only support readable and writable flags */ @@ -66,11 +58,7 @@ int __must_check arm_iommu_unmap_page(struct domain *d, dfn_t dfn, unsigned int order, unsigned int *flush_flags) { - /* - * This function should only be used by gnttab code when the domain - * is direct mapped (i.e. gfn == mfn == dfn). - */ - if ( !is_domain_direct_mapped(d) ) + if ( !domain_use_host_layout(d) ) return -EINVAL; return guest_physmap_remove_page(d, _gfn(dfn_x(dfn)), _mfn(dfn_x(dfn)),