Lines Matching refs:iotlb

41 	struct vhost_iotlb iotlb;
70 struct vhost_iotlb *iotlb, u64 start,
73 static inline u32 iotlb_to_asid(struct vhost_iotlb *iotlb)
75 struct vhost_vdpa_as *as = container_of(iotlb, struct
76 vhost_vdpa_as, iotlb);
99 return &as->iotlb;
117 vhost_iotlb_init(&as->iotlb, 0, 0);
152 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid);
155 * iotlb to the initial or default state, which cannot be
911 static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
919 while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
930 vhost_iotlb_map_free(iotlb, map);
934 static void vhost_vdpa_va_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
940 while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
945 vhost_iotlb_map_free(iotlb, map);
950 struct vhost_iotlb *iotlb, u64 start,
956 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid);
958 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid);
983 static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
989 u32 asid = iotlb_to_asid(iotlb);
992 r = vhost_iotlb_add_range_ctx(iotlb, iova, iova + size - 1,
1001 r = ops->set_map(vdpa, asid, iotlb);
1008 vhost_iotlb_del_range(iotlb, iova, iova + size - 1);
1019 struct vhost_iotlb *iotlb,
1024 u32 asid = iotlb_to_asid(iotlb);
1026 vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid);
1030 ops->set_map(vdpa, asid, iotlb);
1036 struct vhost_iotlb *iotlb,
1066 ret = vhost_vdpa_map(v, iotlb, map_iova, map_size, uaddr,
1079 vhost_vdpa_unmap(v, iotlb, iova, map_iova - iova);
1087 struct vhost_iotlb *iotlb,
1151 ret = vhost_vdpa_map(v, iotlb, iova, csize,
1181 ret = vhost_vdpa_map(v, iotlb, iova, PFN_PHYS(last_pfn - map_pfn + 1),
1201 vhost_vdpa_unmap(v, iotlb, start, size);
1212 struct vhost_iotlb *iotlb,
1222 if (vhost_iotlb_itree_first(iotlb, msg->iova,
1227 return vhost_vdpa_va_map(v, iotlb, msg->iova, msg->size,
1230 return vhost_vdpa_pa_map(v, iotlb, msg->iova, msg->size, msg->uaddr,
1240 struct vhost_iotlb *iotlb = NULL;
1259 iotlb = &as->iotlb;
1261 iotlb = asid_to_iotlb(v, asid);
1263 if ((v->in_batch && v->batch_asid != asid) || !iotlb) {
1268 if (!iotlb)
1269 dev_err(&v->dev, "no iotlb for asid %d\n", asid);
1276 r = vhost_vdpa_process_iotlb_update(v, iotlb, msg);
1279 vhost_vdpa_unmap(v, iotlb, msg->iova, msg->size);
1287 ops->set_map(vdpa, asid, iotlb);