Lines Matching full:asid

71 				   u64 last, u32 asid);
80 static struct vhost_vdpa_as *asid_to_as(struct vhost_vdpa *v, u32 asid) in asid_to_as() argument
82 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in asid_to_as()
86 if (as->id == asid) in asid_to_as()
92 static struct vhost_iotlb *asid_to_iotlb(struct vhost_vdpa *v, u32 asid) in asid_to_iotlb() argument
94 struct vhost_vdpa_as *as = asid_to_as(v, asid); in asid_to_iotlb()
102 static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_alloc_as() argument
104 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in vhost_vdpa_alloc_as()
107 if (asid_to_as(v, asid)) in vhost_vdpa_alloc_as()
110 if (asid >= v->vdpa->nas) in vhost_vdpa_alloc_as()
118 as->id = asid; in vhost_vdpa_alloc_as()
125 u32 asid) in vhost_vdpa_find_alloc_as() argument
127 struct vhost_vdpa_as *as = asid_to_as(v, asid); in vhost_vdpa_find_alloc_as()
132 return vhost_vdpa_alloc_as(v, asid); in vhost_vdpa_find_alloc_as()
135 static void vhost_vdpa_reset_map(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_reset_map() argument
141 ops->reset_map(vdpa, asid); in vhost_vdpa_reset_map()
144 static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_remove_as() argument
146 struct vhost_vdpa_as *as = asid_to_as(v, asid); in vhost_vdpa_remove_as()
152 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid); in vhost_vdpa_remove_as()
160 vhost_vdpa_reset_map(v, asid); in vhost_vdpa_remove_as()
909 struct vhost_iotlb_map *map, u32 asid) in vhost_vdpa_general_unmap() argument
914 ops->dma_unmap(vdpa, asid, map->start, map->size); in vhost_vdpa_general_unmap()
921 u64 start, u64 last, u32 asid) in vhost_vdpa_pa_unmap() argument
938 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_pa_unmap()
944 u64 start, u64 last, u32 asid) in vhost_vdpa_va_unmap() argument
953 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_va_unmap()
960 u64 last, u32 asid) in vhost_vdpa_iotlb_unmap() argument
965 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
967 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
998 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_map() local
1007 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque); in vhost_vdpa_map()
1010 r = ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_map()
1033 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_unmap() local
1035 vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid); in vhost_vdpa_unmap()
1039 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_unmap()
1243 static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid, in vhost_vdpa_process_iotlb_msg() argument
1261 as = vhost_vdpa_find_alloc_as(v, asid); in vhost_vdpa_process_iotlb_msg()
1263 dev_err(&v->dev, "can't find and alloc asid %d\n", in vhost_vdpa_process_iotlb_msg()
1264 asid); in vhost_vdpa_process_iotlb_msg()
1270 iotlb = asid_to_iotlb(v, asid); in vhost_vdpa_process_iotlb_msg()
1272 if ((v->in_batch && v->batch_asid != asid) || !iotlb) { in vhost_vdpa_process_iotlb_msg()
1273 if (v->in_batch && v->batch_asid != asid) { in vhost_vdpa_process_iotlb_msg()
1274 dev_info(&v->dev, "batch id %d asid %d\n", in vhost_vdpa_process_iotlb_msg()
1275 v->batch_asid, asid); in vhost_vdpa_process_iotlb_msg()
1278 dev_err(&v->dev, "no iotlb for asid %d\n", asid); in vhost_vdpa_process_iotlb_msg()
1291 v->batch_asid = asid; in vhost_vdpa_process_iotlb_msg()
1296 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_process_iotlb_msg()
1388 u32 asid; in vhost_vdpa_cleanup() local
1390 for (asid = 0; asid < v->vdpa->nas; asid++) { in vhost_vdpa_cleanup()
1391 as = asid_to_as(v, asid); in vhost_vdpa_cleanup()
1393 vhost_vdpa_remove_as(v, asid); in vhost_vdpa_cleanup()