Lines Matching defs:iotlb
41 struct vhost_iotlb iotlb;
69 struct vhost_iotlb *iotlb, u64 start,
72 static inline u32 iotlb_to_asid(struct vhost_iotlb *iotlb)
74 struct vhost_vdpa_as *as = container_of(iotlb, struct
75 vhost_vdpa_as, iotlb);
98 return &as->iotlb;
116 vhost_iotlb_init(&as->iotlb, 0, 0);
142 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid);
808 static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
816 while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
827 vhost_iotlb_map_free(iotlb, map);
831 static void vhost_vdpa_va_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
837 while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
842 vhost_iotlb_map_free(iotlb, map);
847 struct vhost_iotlb *iotlb, u64 start,
853 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid);
855 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid);
880 static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
886 u32 asid = iotlb_to_asid(iotlb);
889 r = vhost_iotlb_add_range_ctx(iotlb, iova, iova + size - 1,
898 r = ops->set_map(vdpa, asid, iotlb);
904 vhost_iotlb_del_range(iotlb, iova, iova + size - 1);
915 struct vhost_iotlb *iotlb,
920 u32 asid = iotlb_to_asid(iotlb);
922 vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid);
926 ops->set_map(vdpa, asid, iotlb);
932 struct vhost_iotlb *iotlb,
962 ret = vhost_vdpa_map(v, iotlb, map_iova, map_size, uaddr,
975 vhost_vdpa_unmap(v, iotlb, iova, map_iova - iova);
983 struct vhost_iotlb *iotlb,
1047 ret = vhost_vdpa_map(v, iotlb, iova, csize,
1077 ret = vhost_vdpa_map(v, iotlb, iova, PFN_PHYS(last_pfn - map_pfn + 1),
1097 vhost_vdpa_unmap(v, iotlb, start, size);
1108 struct vhost_iotlb *iotlb,
1118 if (vhost_iotlb_itree_first(iotlb, msg->iova,
1123 return vhost_vdpa_va_map(v, iotlb, msg->iova, msg->size,
1126 return vhost_vdpa_pa_map(v, iotlb, msg->iova, msg->size, msg->uaddr,
1136 struct vhost_iotlb *iotlb = NULL;
1155 iotlb = &as->iotlb;
1157 iotlb = asid_to_iotlb(v, asid);
1159 if ((v->in_batch && v->batch_asid != asid) || !iotlb) {
1164 if (!iotlb)
1165 dev_err(&v->dev, "no iotlb for asid %d\n", asid);
1172 r = vhost_vdpa_process_iotlb_update(v, iotlb, msg);
1175 vhost_vdpa_unmap(v, iotlb, msg->iova, msg->size);
1183 ops->set_map(vdpa, asid, iotlb);