Lines Matching full:regions
145 vdev->regions = kcalloc(cnt, sizeof(struct vfio_platform_region), in vfio_platform_regions_init()
147 if (!vdev->regions) in vfio_platform_regions_init()
157 vdev->regions[i].addr = res->start; in vfio_platform_regions_init()
158 vdev->regions[i].size = resource_size(res); in vfio_platform_regions_init()
159 vdev->regions[i].flags = 0; in vfio_platform_regions_init()
163 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_MMIO; in vfio_platform_regions_init()
164 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_READ; in vfio_platform_regions_init()
166 vdev->regions[i].flags |= in vfio_platform_regions_init()
170 * Only regions addressed with PAGE granularity may be in vfio_platform_regions_init()
173 if (!(vdev->regions[i].addr & ~PAGE_MASK) && in vfio_platform_regions_init()
174 !(vdev->regions[i].size & ~PAGE_MASK)) in vfio_platform_regions_init()
175 vdev->regions[i].flags |= in vfio_platform_regions_init()
180 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_PIO; in vfio_platform_regions_init()
191 kfree(vdev->regions); in vfio_platform_regions_init()
200 iounmap(vdev->regions[i].ioaddr); in vfio_platform_regions_cleanup()
203 kfree(vdev->regions); in vfio_platform_regions_cleanup()
321 info.size = vdev->regions[info.index].size; in vfio_platform_ioctl()
322 info.flags = vdev->regions[info.index].flags; in vfio_platform_ioctl()
452 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ)) in vfio_platform_read()
455 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_read()
456 return vfio_platform_read_mmio(&vdev->regions[index], in vfio_platform_read()
458 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_read()
529 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) in vfio_platform_write()
532 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_write()
533 return vfio_platform_write_mmio(&vdev->regions[index], in vfio_platform_write()
535 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_write()
580 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP)) in vfio_platform_mmap()
583 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) in vfio_platform_mmap()
587 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) in vfio_platform_mmap()
593 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_mmap()
594 return vfio_platform_mmap_mmio(vdev->regions[index], vma); in vfio_platform_mmap()
596 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_mmap()