int vhost_backend_update_device_iotlb(struct vhost_dev *dev,

                                             uint64_t iova, uint64_t uaddr,

                                             uint64_t len,

                                             IOMMUAccessFlags perm)

{

    struct vhost_iotlb_msg imsg;



    imsg.iova =  iova;

    imsg.uaddr = uaddr;

    imsg.size = len;

    imsg.type = VHOST_IOTLB_UPDATE;



    switch (perm) {

    case IOMMU_RO:

        imsg.perm = VHOST_ACCESS_RO;

        break;

    case IOMMU_WO:

        imsg.perm = VHOST_ACCESS_WO;

        break;

    case IOMMU_RW:

        imsg.perm = VHOST_ACCESS_RW;

        break;

    default:

        return -EINVAL;

    }



    return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);

}

int vhost_backend_update_device_iotlb(struct vhost_dev *dev,

                                             uint64_t iova, uint64_t uaddr,

                                             uint64_t len,

                                             IOMMUAccessFlags perm)

{

    struct vhost_iotlb_msg imsg;



    imsg.iova =  iova;

    imsg.uaddr = uaddr;

    imsg.size = len;

    imsg.type = VHOST_IOTLB_UPDATE;



    switch (perm) {

    case IOMMU_RO:

        imsg.perm = VHOST_ACCESS_RO;

        break;

    case IOMMU_WO:

        imsg.perm = VHOST_ACCESS_WO;

        break;

    case IOMMU_RW:

        imsg.perm = VHOST_ACCESS_RW;

        break;

    default:

        return -EINVAL;

    }



    return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);

}

    return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);     return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);
int FUNC_0(struct vhost_dev *VAR_0,

                                             uint64_t VAR_1, uint64_t VAR_2,

                                             uint64_t VAR_3,

                                             IOMMUAccessFlags VAR_4)

{

    struct vhost_iotlb_msg VAR_5;



    VAR_5.VAR_1 =  VAR_1;

    VAR_5.VAR_2 = VAR_2;

    VAR_5.size = VAR_3;

    VAR_5.type = VHOST_IOTLB_UPDATE;



    switch (VAR_4) {

    case IOMMU_RO:

        VAR_5.VAR_4 = VHOST_ACCESS_RO;

        break;

    case IOMMU_WO:

        VAR_5.VAR_4 = VHOST_ACCESS_WO;

        break;

    case IOMMU_RW:

        VAR_5.VAR_4 = VHOST_ACCESS_RW;

        break;

    default:

        return -EINVAL;

    }



    return VAR_0->vhost_ops->vhost_send_device_iotlb_msg(VAR_0, &VAR_5);

}

int FUNC_0(struct vhost_dev *VAR_0,
uint64_t VAR_1, uint64_t VAR_2,
uint64_t VAR_3,
IOMMUAccessFlags VAR_4)
{ struct vhost_iotlb_msg VAR_5; VAR_5.VAR_1 =  VAR_1; VAR_5.VAR_2 = VAR_2; VAR_5.size = VAR_3; VAR_5.type = VHOST_IOTLB_UPDATE; switch (VAR_4) { case IOMMU_RO:
VAR_5.VAR_4 = VHOST_ACCESS_RO; break; case IOMMU_WO:
VAR_5.VAR_4 = VHOST_ACCESS_WO; break; case IOMMU_RW:
VAR_5.VAR_4 = VHOST_ACCESS_RW; break; default:
return -EINVAL; } return VAR_0->vhost_ops->vhost_send_device_iotlb_msg(VAR_0, &VAR_5); }