diff --git a/xen/drivers/passthrough/arm/iommu_helpers.c b/xen/drivers/passthrough/arm/iommu_helpers.c index bdb271584b..a3e3cafb87 100644 --- a/xen/drivers/passthrough/arm/iommu_helpers.c +++ b/xen/drivers/passthrough/arm/iommu_helpers.c @@ -36,9 +36,6 @@ int __must_check arm_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn, { p2m_type_t t; - BUG_ON(!domain_use_host_layout(d)); - BUG_ON(mfn_x(mfn) != dfn_x(dfn)); - /* We only support readable and writable flags */ if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) ) return -EINVAL; @@ -49,7 +46,7 @@ int __must_check arm_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn, * The function guest_physmap_add_entry replaces the current mapping * if there is already one... */ - return guest_physmap_add_entry(d, _gfn(dfn_x(dfn)), _mfn(dfn_x(dfn)), + return guest_physmap_add_entry(d, _gfn(dfn_x(dfn)), mfn, IOMMUF_order(flags), t); } @@ -58,11 +55,7 @@ int __must_check arm_iommu_unmap_page(struct domain *d, dfn_t dfn, unsigned int order, unsigned int *flush_flags) { - if ( !domain_use_host_layout(d) ) - return -EINVAL; - - return guest_physmap_remove_page(d, _gfn(dfn_x(dfn)), _mfn(dfn_x(dfn)), - order); + return guest_physmap_remove_page(d, _gfn(dfn_x(dfn)), INVALID_MFN, order); } /*