Lines Matching full:asid

70 				   u64 last, u32 asid);
79 static struct vhost_vdpa_as *asid_to_as(struct vhost_vdpa *v, u32 asid) in asid_to_as() argument
81 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in asid_to_as()
85 if (as->id == asid) in asid_to_as()
91 static struct vhost_iotlb *asid_to_iotlb(struct vhost_vdpa *v, u32 asid) in asid_to_iotlb() argument
93 struct vhost_vdpa_as *as = asid_to_as(v, asid); in asid_to_iotlb()
101 static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_alloc_as() argument
103 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in vhost_vdpa_alloc_as()
106 if (asid_to_as(v, asid)) in vhost_vdpa_alloc_as()
109 if (asid >= v->vdpa->nas) in vhost_vdpa_alloc_as()
117 as->id = asid; in vhost_vdpa_alloc_as()
124 u32 asid) in vhost_vdpa_find_alloc_as() argument
126 struct vhost_vdpa_as *as = asid_to_as(v, asid); in vhost_vdpa_find_alloc_as()
131 return vhost_vdpa_alloc_as(v, asid); in vhost_vdpa_find_alloc_as()
134 static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_remove_as() argument
136 struct vhost_vdpa_as *as = asid_to_as(v, asid); in vhost_vdpa_remove_as()
142 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid); in vhost_vdpa_remove_as()
806 struct vhost_iotlb_map *map, u32 asid) in vhost_vdpa_general_unmap() argument
811 ops->dma_unmap(vdpa, asid, map->start, map->size); in vhost_vdpa_general_unmap()
818 u64 start, u64 last, u32 asid) in vhost_vdpa_pa_unmap() argument
835 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_pa_unmap()
841 u64 start, u64 last, u32 asid) in vhost_vdpa_va_unmap() argument
850 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_va_unmap()
857 u64 last, u32 asid) in vhost_vdpa_iotlb_unmap() argument
862 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
864 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
895 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_map() local
904 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque); in vhost_vdpa_map()
907 r = ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_map()
929 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_unmap() local
931 vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid); in vhost_vdpa_unmap()
935 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_unmap()
1139 static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid, in vhost_vdpa_process_iotlb_msg() argument
1157 as = vhost_vdpa_find_alloc_as(v, asid); in vhost_vdpa_process_iotlb_msg()
1159 dev_err(&v->dev, "can't find and alloc asid %d\n", in vhost_vdpa_process_iotlb_msg()
1160 asid); in vhost_vdpa_process_iotlb_msg()
1166 iotlb = asid_to_iotlb(v, asid); in vhost_vdpa_process_iotlb_msg()
1168 if ((v->in_batch && v->batch_asid != asid) || !iotlb) { in vhost_vdpa_process_iotlb_msg()
1169 if (v->in_batch && v->batch_asid != asid) { in vhost_vdpa_process_iotlb_msg()
1170 dev_info(&v->dev, "batch id %d asid %d\n", in vhost_vdpa_process_iotlb_msg()
1171 v->batch_asid, asid); in vhost_vdpa_process_iotlb_msg()
1174 dev_err(&v->dev, "no iotlb for asid %d\n", asid); in vhost_vdpa_process_iotlb_msg()
1187 v->batch_asid = asid; in vhost_vdpa_process_iotlb_msg()
1192 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_process_iotlb_msg()
1286 u32 asid; in vhost_vdpa_cleanup() local
1288 for (asid = 0; asid < v->vdpa->nas; asid++) { in vhost_vdpa_cleanup()
1289 as = asid_to_as(v, asid); in vhost_vdpa_cleanup()
1291 vhost_vdpa_remove_as(v, asid); in vhost_vdpa_cleanup()