Lines Matching full:be
27 IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); in iommufd_backend_init() local
29 be->fd = -1; in iommufd_backend_init()
30 be->users = 0; in iommufd_backend_init()
31 be->owned = true; in iommufd_backend_init()
36 IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); in iommufd_backend_finalize() local
38 if (be->owned) { in iommufd_backend_finalize()
39 close(be->fd); in iommufd_backend_finalize()
40 be->fd = -1; in iommufd_backend_finalize()
47 IOMMUFDBackend *be = IOMMUFD_BACKEND(obj); in iommufd_backend_set_fd() local
55 be->fd = fd; in iommufd_backend_set_fd()
56 be->owned = false; in iommufd_backend_set_fd()
57 trace_iommu_backend_set_fd(be->fd); in iommufd_backend_set_fd()
62 IOMMUFDBackend *be = IOMMUFD_BACKEND(uc); in iommufd_backend_can_be_deleted() local
64 return !be->users; in iommufd_backend_can_be_deleted()
76 bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp) in iommufd_backend_connect() argument
80 if (be->owned && !be->users) { in iommufd_backend_connect()
85 be->fd = fd; in iommufd_backend_connect()
87 be->users++; in iommufd_backend_connect()
89 trace_iommufd_backend_connect(be->fd, be->owned, be->users); in iommufd_backend_connect()
93 void iommufd_backend_disconnect(IOMMUFDBackend *be) in iommufd_backend_disconnect() argument
95 if (!be->users) { in iommufd_backend_disconnect()
98 be->users--; in iommufd_backend_disconnect()
99 if (!be->users && be->owned) { in iommufd_backend_disconnect()
100 close(be->fd); in iommufd_backend_disconnect()
101 be->fd = -1; in iommufd_backend_disconnect()
104 trace_iommufd_backend_disconnect(be->fd, be->users); in iommufd_backend_disconnect()
107 bool iommufd_backend_alloc_ioas(IOMMUFDBackend *be, uint32_t *ioas_id, in iommufd_backend_alloc_ioas() argument
110 int fd = be->fd; in iommufd_backend_alloc_ioas()
127 void iommufd_backend_free_id(IOMMUFDBackend *be, uint32_t id) in iommufd_backend_free_id() argument
129 int ret, fd = be->fd; in iommufd_backend_free_id()
142 int iommufd_backend_map_dma(IOMMUFDBackend *be, uint32_t ioas_id, hwaddr iova, in iommufd_backend_map_dma() argument
145 int ret, fd = be->fd; in iommufd_backend_map_dma()
177 int iommufd_backend_unmap_dma(IOMMUFDBackend *be, uint32_t ioas_id, in iommufd_backend_unmap_dma() argument
180 int ret, fd = be->fd; in iommufd_backend_unmap_dma()
211 bool iommufd_backend_alloc_hwpt(IOMMUFDBackend *be, uint32_t dev_id, in iommufd_backend_alloc_hwpt() argument
217 int ret, fd = be->fd; in iommufd_backend_alloc_hwpt()
241 bool iommufd_backend_set_dirty_tracking(IOMMUFDBackend *be, in iommufd_backend_set_dirty_tracking() argument
252 ret = ioctl(be->fd, IOMMU_HWPT_SET_DIRTY_TRACKING, &set_dirty); in iommufd_backend_set_dirty_tracking()
253 trace_iommufd_backend_set_dirty(be->fd, hwpt_id, start, ret ? errno : 0); in iommufd_backend_set_dirty_tracking()
264 bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, in iommufd_backend_get_dirty_bitmap() argument
280 ret = ioctl(be->fd, IOMMU_HWPT_GET_DIRTY_BITMAP, &get_dirty_bitmap); in iommufd_backend_get_dirty_bitmap()
281 trace_iommufd_backend_get_dirty_bitmap(be->fd, hwpt_id, iova, size, in iommufd_backend_get_dirty_bitmap()
293 bool iommufd_backend_get_device_info(IOMMUFDBackend *be, uint32_t devid, in iommufd_backend_get_device_info() argument
304 if (ioctl(be->fd, IOMMU_GET_HW_INFO, &info)) { in iommufd_backend_get_device_info()