search for: vfio_vhost_num_regions

Displaying 4 results from an estimated 4 matches for "vfio_vhost_num_regions".

2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...struct vfio_region_info *region_info, + u16 *cap_type_id, void **cap_type) +{ + struct vdpa_dev *vdpa; + u32 index, flags; + u64 size = 0; + + if (!mdev) + return -EINVAL; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -EINVAL; + + index = region_info->index; + if (index >= VFIO_VHOST_NUM_REGIONS) + return -EINVAL; + + mutex_lock(&vdpa->ops_lock); + + flags = VFIO_REGION_INFO_FLAG_READ | VFIO_REGION_INFO_FLAG_WRITE; + + switch (index) { + case VFIO_VHOST_CONFIG_REGION_INDEX: + size = VDPA_CONFIG_SIZE; + break; + case VFIO_VHOST_NOTIFY_REGION_INDEX: + size = (u64)vdpa->max_vrin...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...struct vfio_region_info *region_info, + u16 *cap_type_id, void **cap_type) +{ + struct vdpa_dev *vdpa; + u32 index, flags; + u64 size = 0; + + if (!mdev) + return -EINVAL; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -EINVAL; + + index = region_info->index; + if (index >= VFIO_VHOST_NUM_REGIONS) + return -EINVAL; + + mutex_lock(&vdpa->ops_lock); + + flags = VFIO_REGION_INFO_FLAG_READ | VFIO_REGION_INFO_FLAG_WRITE; + + switch (index) { + case VFIO_VHOST_CONFIG_REGION_INDEX: + size = VDPA_CONFIG_SIZE; + break; + case VFIO_VHOST_NOTIFY_REGION_INDEX: + size = (u64)vdpa->max_vrin...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...bus driver makes use of the following fixed region and > + * IRQ index mapping. Unimplemented regions return a size of zero. > + * Unimplemented IRQ types return a count of zero. > + */ > + > +enum { > + VFIO_VHOST_CONFIG_REGION_INDEX, > + VFIO_VHOST_NOTIFY_REGION_INDEX, > + VFIO_VHOST_NUM_REGIONS > +}; > + > +enum { > + VFIO_VHOST_VQ_IRQ_INDEX, > + VFIO_VHOST_NUM_IRQS > +}; > + Note that the vfio API has evolved a bit since vfio-pci started this way, with fixed indexes for pre-defined region types. We now support device specific regions which can be identified by a ca...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...**cap_type) > +{ > + struct vdpa_dev *vdpa; > + u32 index, flags; > + u64 size = 0; > + > + if (!mdev) > + return -EINVAL; > + > + vdpa = mdev_get_drvdata(mdev); > + if (!vdpa) > + return -EINVAL; > + > + index = region_info->index; > + if (index >= VFIO_VHOST_NUM_REGIONS) > + return -EINVAL; > + > + mutex_lock(&vdpa->ops_lock); > + > + flags = VFIO_REGION_INFO_FLAG_READ | VFIO_REGION_INFO_FLAG_WRITE; > + > + switch (index) { > + case VFIO_VHOST_CONFIG_REGION_INDEX: > + size = VDPA_CONFIG_SIZE; > + break; > + case VFIO_VHOS...