Lines Matching defs:asid

70 				   u64 last, u32 asid);
79 static struct vhost_vdpa_as *asid_to_as(struct vhost_vdpa *v, u32 asid)
81 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS];
85 if (as->id == asid)
91 static struct vhost_iotlb *asid_to_iotlb(struct vhost_vdpa *v, u32 asid)
93 struct vhost_vdpa_as *as = asid_to_as(v, asid);
101 static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid)
103 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS];
106 if (asid_to_as(v, asid))
109 if (asid >= v->vdpa->nas)
117 as->id = asid;
124 u32 asid)
126 struct vhost_vdpa_as *as = asid_to_as(v, asid);
131 return vhost_vdpa_alloc_as(v, asid);
134 static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid)
136 struct vhost_vdpa_as *as = asid_to_as(v, asid);
142 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid);
797 struct vhost_iotlb_map *map, u32 asid)
802 ops->dma_unmap(vdpa, asid, map->start, map->size);
809 u64 start, u64 last, u32 asid)
826 vhost_vdpa_general_unmap(v, map, asid);
832 u64 start, u64 last, u32 asid)
841 vhost_vdpa_general_unmap(v, map, asid);
848 u64 last, u32 asid)
853 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid);
855 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid);
886 u32 asid = iotlb_to_asid(iotlb);
895 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque);
898 r = ops->set_map(vdpa, asid, 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);
1130 static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid,
1148 as = vhost_vdpa_find_alloc_as(v, asid);
1150 dev_err(&v->dev, "can't find and alloc asid %d\n",
1151 asid);
1157 iotlb = asid_to_iotlb(v, asid);
1159 if ((v->in_batch && v->batch_asid != asid) || !iotlb) {
1160 if (v->in_batch && v->batch_asid != asid) {
1161 dev_info(&v->dev, "batch id %d asid %d\n",
1162 v->batch_asid, asid);
1165 dev_err(&v->dev, "no iotlb for asid %d\n", asid);
1178 v->batch_asid = asid;
1183 ops->set_map(vdpa, asid, iotlb);
1277 u32 asid;
1279 for (asid = 0; asid < v->vdpa->nas; asid++) {
1280 as = asid_to_as(v, asid);
1282 vhost_vdpa_remove_as(v, asid);