return 0;
        }
 
-       /*
-        * If the driver doesn't provide this op then it means the device does
-        * not do DMA at all. So nothing to do.
-        */
-       if (!vdev->ops->bind_iommufd)
-               return 0;
+       if (WARN_ON(!vdev->ops->bind_iommufd))
+               return -ENODEV;
 
        ret = vdev->ops->bind_iommufd(vdev, ictx, &device_id);
        if (ret)
 /*
  * The emulated standard ops mean that vfio_device is going to use the
  * "mdev path" and will call vfio_pin_pages()/vfio_dma_rw(). Drivers using this
- * ops set should call vfio_register_emulated_iommu_dev().
+ * ops set should call vfio_register_emulated_iommu_dev(). Drivers that do
+ * not call vfio_pin_pages()/vfio_dma_rw() have no need to provide dma_unmap.
  */
 
 static void vfio_emulated_unmap(void *data, unsigned long iova,
 {
        struct vfio_device *vdev = data;
 
-       vdev->ops->dma_unmap(vdev, iova, length);
+       if (vdev->ops->dma_unmap)
+               vdev->ops->dma_unmap(vdev, iova, length);
 }
 
 static const struct iommufd_access_ops vfio_user_ops = {
 
        .write = mbochs_write,
        .ioctl = mbochs_ioctl,
        .mmap = mbochs_mmap,
+       .bind_iommufd   = vfio_iommufd_emulated_bind,
+       .unbind_iommufd = vfio_iommufd_emulated_unbind,
+       .attach_ioas    = vfio_iommufd_emulated_attach_ioas,
 };
 
 static struct mdev_driver mbochs_driver = {
 
        .write = mdpy_write,
        .ioctl = mdpy_ioctl,
        .mmap = mdpy_mmap,
+       .bind_iommufd   = vfio_iommufd_emulated_bind,
+       .unbind_iommufd = vfio_iommufd_emulated_unbind,
+       .attach_ioas    = vfio_iommufd_emulated_attach_ioas,
 };
 
 static struct mdev_driver mdpy_driver = {
 
        .read = mtty_read,
        .write = mtty_write,
        .ioctl = mtty_ioctl,
+       .bind_iommufd   = vfio_iommufd_emulated_bind,
+       .unbind_iommufd = vfio_iommufd_emulated_unbind,
+       .attach_ioas    = vfio_iommufd_emulated_attach_ioas,
 };
 
 static struct mdev_driver mtty_driver = {