+void s390_pci_iommu_dm_enable(S390PCIIOMMU *iommu)
+{
+ MachineState *ms = MACHINE(qdev_get_machine());
+
+ /*
+ * For direct-mapping we must map the entire guest address space. Because
+ * the mappings are contiguous we are not restricted to individual 4K
+ * mappings via vfio, so let's not worry about the DMA limit when
+ * calculating the range.
+ */
+ char *name = g_strdup_printf("iommu-s390-%04x", iommu->pbdev->uid);
+ memory_region_init_iommu(&iommu->iommu_mr, sizeof(iommu->iommu_mr),
+ TYPE_S390_IOMMU_MEMORY_REGION, OBJECT(&iommu->mr),
+ name, iommu->pba + ms->ram_size);
+ iommu->enabled = true;
+ iommu->direct_map = true;
memory_region_add_subregion(&iommu->mr, 0,
MEMORY_REGION(&iommu->iommu_mr));
g_free(name);
}