Lines Matching refs: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()
723 struct vhost_iotlb_map *map, u32 asid) in vhost_vdpa_general_unmap() argument
728 ops->dma_unmap(vdpa, asid, map->start, map->size); in vhost_vdpa_general_unmap()
735 u64 start, u64 last, u32 asid) in vhost_vdpa_pa_unmap() argument
752 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_pa_unmap()
758 u64 start, u64 last, u32 asid) in vhost_vdpa_va_unmap() argument
767 vhost_vdpa_general_unmap(v, map, asid); in vhost_vdpa_va_unmap()
774 u64 last, u32 asid) in vhost_vdpa_iotlb_unmap() argument
779 return vhost_vdpa_va_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
781 return vhost_vdpa_pa_unmap(v, iotlb, start, last, asid); in vhost_vdpa_iotlb_unmap()
812 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_map() local
821 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque); in vhost_vdpa_map()
824 r = ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_map()
846 u32 asid = iotlb_to_asid(iotlb); in vhost_vdpa_unmap() local
848 vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid); in vhost_vdpa_unmap()
852 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_unmap()
858 vhost_vdpa_remove_as(v, asid); in vhost_vdpa_unmap()
1060 static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid, in vhost_vdpa_process_iotlb_msg() argument
1078 as = vhost_vdpa_find_alloc_as(v, asid); in vhost_vdpa_process_iotlb_msg()
1081 asid); in vhost_vdpa_process_iotlb_msg()
1087 iotlb = asid_to_iotlb(v, asid); in vhost_vdpa_process_iotlb_msg()
1089 if ((v->in_batch && v->batch_asid != asid) || !iotlb) { in vhost_vdpa_process_iotlb_msg()
1090 if (v->in_batch && v->batch_asid != asid) { in vhost_vdpa_process_iotlb_msg()
1092 v->batch_asid, asid); in vhost_vdpa_process_iotlb_msg()
1095 dev_err(&v->dev, "no iotlb for asid %d\n", asid); in vhost_vdpa_process_iotlb_msg()
1108 v->batch_asid = asid; in vhost_vdpa_process_iotlb_msg()
1113 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_process_iotlb_msg()
1116 vhost_vdpa_remove_as(v, asid); in vhost_vdpa_process_iotlb_msg()
1208 u32 asid; in vhost_vdpa_cleanup() local
1210 for (asid = 0; asid < v->vdpa->nas; asid++) { in vhost_vdpa_cleanup()
1211 as = asid_to_as(v, asid); in vhost_vdpa_cleanup()
1213 vhost_vdpa_remove_as(v, asid); in vhost_vdpa_cleanup()