Displaying 4 results from an estimated 4 matches for "err_put_device".
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...file);
+ if (IS_ERR(group)) {
+ r = PTR_ERR(group);
+ goto err;
+ }
+
+ device = vfio_device_get_from_fd(group, backend.device_fd);
+ if (!IS_ERR(device)) {
+ r = PTR_ERR(device);
+ goto err_put_group;
+ }
+
+ if (!vfio_device_ops_match(device, &vfio_mdev_dev_ops)) {
+ r = -EINVAL;
+ goto err_put_device;
+ }
+
+ mdev = vfio_device_data(m->vfio_device);
+
+ magic = virtio_mdev_readl(mdev, VIRTIO_MDEV_MAGIC_VALUE);
+ if (magic != ('v' | 'i' << 8 | 'r' << 16 | 't' << 24)) {
+ r = -ENODEV;
+ goto err_put_device;
+ }
+
+ mdev_reset(mdev);
+ mdev_ad...
2019 Sep 17
1
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...goto err;
> + }
> +
> + device = vfio_device_get_from_fd(group, backend.device_fd);
> + if (!IS_ERR(device)) {
> + r = PTR_ERR(device);
> + goto err_put_group;
> + }
> +
> + if (!vfio_device_ops_match(device, &vfio_mdev_dev_ops)) {
> + r = -EINVAL;
> + goto err_put_device;
> + }
It looks to me that we can avoid to expose vfio_mdev_dev_ops here.
> +
> + mdev = vfio_device_data(m->vfio_device);
> +
> + magic = virtio_mdev_readl(mdev, VIRTIO_MDEV_MAGIC_VALUE);
> + if (magic != ('v' | 'i' << 8 | 'r' << 16 | ...
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU