Lines Matching defs:asid

71 				   u64 last, u32 asid);
80 static struct vhost_vdpa_as *asid_to_as(struct vhost_vdpa *v, u32 asid)
82 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS];
86 if (as->id == asid)
92 static struct vhost_iotlb *asid_to_iotlb(struct vhost_vdpa *v, u32 asid)
94 struct vhost_vdpa_as *as = asid_to_as(v, asid);
102 static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid)
104 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS];
107 if (asid_to_as(v, asid))
110 if (asid >= v->vdpa->nas)
118 as->id = asid;
125 u32 asid)
127 struct vhost_vdpa_as *as = asid_to_as(v, asid);
132 return vhost_vdpa_alloc_as(v, asid);
135 static void vhost_vdpa_reset_map(struct vhost_vdpa *v, u32 asid)
141 ops->reset_map(vdpa, asid);
144 static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid)
146 struct vhost_vdpa_as *as = asid_to_as(v, asid);
152 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid);
160 vhost_vdpa_reset_map(v, asid);
900 struct vhost_iotlb_map *map, u32 asid)
905 ops->dma_unmap(vdpa, asid, map->start, map->size);
912 u64 start, u64 last, u32 asid)
929 vhost_vdpa_general_unmap(v, map, asid);
935 u64 start, u64 last, u32 asid)
944 vhost_vdpa_general_unmap(v, map, asid);
951 u64 last, u32 asid)
956 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid);
958 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid);
989 u32 asid = iotlb_to_asid(iotlb);
998 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque);
1001 r = ops->set_map(vdpa, asid, 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);
1234 static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid,
1252 as = vhost_vdpa_find_alloc_as(v, asid);
1254 dev_err(&v->dev, "can't find and alloc asid %d\n",
1255 asid);
1261 iotlb = asid_to_iotlb(v, asid);
1263 if ((v->in_batch && v->batch_asid != asid) || !iotlb) {
1264 if (v->in_batch && v->batch_asid != asid) {
1265 dev_info(&v->dev, "batch id %d asid %d\n",
1266 v->batch_asid, asid);
1269 dev_err(&v->dev, "no iotlb for asid %d\n", asid);
1282 v->batch_asid = asid;
1287 ops->set_map(vdpa, asid, iotlb);
1381 u32 asid;
1383 for (asid = 0; asid < v->vdpa->nas; asid++) {
1384 as = asid_to_as(v, asid);
1386 vhost_vdpa_remove_as(v, asid);