Lines Matching refs:vdpa

50 	struct vdpa_device *vdpa;  member
109 if (asid >= v->vdpa->nas) in vhost_vdpa_alloc_as()
153 const struct vdpa_config_ops *ops = v->vdpa->config; in handle_vq_kick()
155 ops->kick_vq(v->vdpa, vq - v->vqs); in handle_vq_kick()
183 const struct vdpa_config_ops *ops = v->vdpa->config; in vhost_vdpa_setup_vq_irq()
184 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_setup_vq_irq() local
190 irq = ops->get_vq_irq(vdpa, qid); in vhost_vdpa_setup_vq_irq()
213 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_reset() local
217 return vdpa_reset(vdpa); in vhost_vdpa_reset()
222 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_bind_mm() local
223 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_bind_mm()
225 if (!vdpa->use_va || !ops->bind_mm) in vhost_vdpa_bind_mm()
228 return ops->bind_mm(vdpa, v->vdev.mm); in vhost_vdpa_bind_mm()
233 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_unbind_mm() local
234 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_unbind_mm()
236 if (!vdpa->use_va || !ops->unbind_mm) in vhost_vdpa_unbind_mm()
239 ops->unbind_mm(vdpa); in vhost_vdpa_unbind_mm()
244 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_device_id() local
245 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_device_id()
248 device_id = ops->get_device_id(vdpa); in vhost_vdpa_get_device_id()
258 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_status() local
259 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_status()
262 status = ops->get_status(vdpa); in vhost_vdpa_get_status()
272 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_status() local
273 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_status()
282 status_old = ops->get_status(vdpa); in vhost_vdpa_set_status()
296 ret = vdpa_reset(vdpa); in vhost_vdpa_set_status()
300 vdpa_set_status(vdpa, status); in vhost_vdpa_set_status()
312 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_config_validate() local
313 size_t size = vdpa->config->get_config_size(vdpa); in vhost_vdpa_config_validate()
327 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config() local
340 vdpa_get_config(vdpa, config.off, buf, config.len); in vhost_vdpa_get_config()
354 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_config() local
368 vdpa_set_config(vdpa, config.off, buf, config.len); in vhost_vdpa_set_config()
376 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_can_suspend() local
377 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_can_suspend()
384 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_can_resume() local
385 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_can_resume()
392 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_features() local
393 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_features()
396 features = ops->get_device_features(vdpa); in vhost_vdpa_get_features()
406 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_backend_features() local
407 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_backend_features()
412 return ops->get_backend_features(vdpa); in vhost_vdpa_get_backend_features()
417 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_features() local
418 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_features()
428 if (ops->get_status(vdpa) & VIRTIO_CONFIG_S_FEATURES_OK) in vhost_vdpa_set_features()
434 if (vdpa_set_features(vdpa, features)) in vhost_vdpa_set_features()
438 actual_features = ops->get_driver_features(vdpa); in vhost_vdpa_set_features()
452 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_vring_num() local
453 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_vring_num()
456 num = ops->get_vq_num_max(vdpa); in vhost_vdpa_get_vring_num()
496 v->vdpa->config->set_config_cb(v->vdpa, &cb); in vhost_vdpa_set_config_call()
515 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config_size() local
516 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_config_size()
519 size = ops->get_config_size(vdpa); in vhost_vdpa_get_config_size()
529 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_vqs_count() local
531 if (copy_to_user(argp, &vdpa->nvqs, sizeof(vdpa->nvqs))) in vhost_vdpa_get_vqs_count()
544 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_suspend() local
545 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_suspend()
550 return ops->suspend(vdpa); in vhost_vdpa_suspend()
559 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_resume() local
560 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_resume()
565 return ops->resume(vdpa); in vhost_vdpa_resume()
571 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_vring_ioctl() local
572 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_vring_ioctl()
594 ops->set_vq_ready(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
600 s.num = ops->get_vq_group(vdpa, idx); in vhost_vdpa_vring_ioctl()
601 if (s.num >= vdpa->ngroups) in vhost_vdpa_vring_ioctl()
609 if (s.num >= vdpa->nas) in vhost_vdpa_vring_ioctl()
613 return ops->set_group_asid(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
615 r = ops->get_vq_state(v->vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
630 if (ops->get_status(vdpa) & in vhost_vdpa_vring_ioctl()
644 if (ops->set_vq_address(vdpa, idx, in vhost_vdpa_vring_ioctl()
660 r = ops->set_vq_state(vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
669 if (ops->get_status(vdpa) & in vhost_vdpa_vring_ioctl()
677 ops->set_vq_cb(vdpa, idx, &cb); in vhost_vdpa_vring_ioctl()
681 ops->set_vq_num(vdpa, idx, vq->num); in vhost_vdpa_vring_ioctl()
744 if (copy_to_user(argp, &v->vdpa->ngroups, in vhost_vdpa_unlocked_ioctl()
745 sizeof(v->vdpa->ngroups))) in vhost_vdpa_unlocked_ioctl()
749 if (copy_to_user(argp, &v->vdpa->nas, sizeof(v->vdpa->nas))) in vhost_vdpa_unlocked_ioctl()
808 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_general_unmap() local
809 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_general_unmap()
811 ops->dma_unmap(vdpa, asid, map->start, map->size); in vhost_vdpa_general_unmap()
859 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_iotlb_unmap() local
861 if (vdpa->use_va) in vhost_vdpa_iotlb_unmap()
893 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_map() local
894 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_map()
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()
917 if (!vdpa->use_va) in vhost_vdpa_map()
927 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_unmap() local
928 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_unmap()
935 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_unmap()
1120 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_update() local
1131 if (vdpa->use_va) in vhost_vdpa_process_iotlb_update()
1143 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_msg() local
1144 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_process_iotlb_msg()
1192 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_process_iotlb_msg()
1217 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_alloc_domain() local
1218 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_alloc_domain()
1219 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_alloc_domain()
1255 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_free_domain() local
1256 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_free_domain()
1269 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_iova_range() local
1270 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_iova_range()
1273 *range = ops->get_iova_range(vdpa); in vhost_vdpa_set_iova_range()
1288 for (asid = 0; asid < v->vdpa->nas; asid++) { in vhost_vdpa_cleanup()
1383 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_fault() local
1384 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_fault()
1389 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_fault()
1401 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_mmap() local
1402 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_mmap()
1421 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_mmap()
1455 static int vhost_vdpa_probe(struct vdpa_device *vdpa) in vhost_vdpa_probe() argument
1457 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_probe()
1466 (vdpa->ngroups > 1 || vdpa->nas > 1)) in vhost_vdpa_probe()
1482 v->vdpa = vdpa; in vhost_vdpa_probe()
1483 v->nvqs = vdpa->nvqs; in vhost_vdpa_probe()
1484 v->virtio_id = ops->get_device_id(vdpa); in vhost_vdpa_probe()
1488 v->dev.parent = &vdpa->dev; in vhost_vdpa_probe()
1509 vdpa_set_drvdata(vdpa, v); in vhost_vdpa_probe()
1521 static void vhost_vdpa_remove(struct vdpa_device *vdpa) in vhost_vdpa_remove() argument
1523 struct vhost_vdpa *v = vdpa_get_drvdata(vdpa); in vhost_vdpa_remove()