Displaying 20 results from an estimated 45 matches for "vhost_set_log_base".
2015 Apr 15
0
[PATCH] vhost: fix log base address
VHOST_SET_LOG_BASE got an incorrect address, causing
migration errors and potentially even memory corruption.
Cc: Peter Maydell <peter.maydell at linaro.org>
Reported-by: Wen Congyang <wency at cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Could you please confirm this...
2015 Apr 15
0
[PATCH] vhost: fix log base address
VHOST_SET_LOG_BASE got an incorrect address, causing
migration errors and potentially even memory corruption.
Cc: Peter Maydell <peter.maydell at linaro.org>
Reported-by: Wen Congyang <wency at cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Could you please confirm this...
2019 Nov 07
1
[PATCH v5] vhost: introduce mdev based hardware backend
On 2019/11/6 ??10:49, Tiwei Bie wrote:
>>>>>> +	default:
>>>>>> +		/*
>>>>>> +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
>>>>>> +		 * VHOST_SET_LOG_FD are not used yet.
>>>>>> +		 */
>>>>> If we don't even use them, there's probably no need to call
>>>>> vhost_dev_ioctl(). This may help to avoid confusion when we want to develop
>>&g...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...return -ENODEV;
> +
> +	vdpa->pending_reply = true;
> +	vdpa->pending.request = VHOST_GET_VRING_BASE;
> +	vdpa->pending.payload.state.index = qid;
> +	vdpa->pending.payload.state.num = vdpa->vring_info[qid].base;
> +
> +	return 0;
> +}
> +
> +static int vhost_set_log_base(struct mdev_device *mdev, u64 *log_base)
> +{
> +	struct vdpa_dev *vdpa;
> +
> +	vdpa = mdev_get_drvdata(mdev);
> +	if (!vdpa)
> +		return -ENODEV;
> +
> +	vdpa->log_base = *log_base;
> +	return 0;
> +}
> +
> +static int vhost_set_features(struct mdev_device *...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...+
+	vdpa = mdev_get_drvdata(mdev);
+	if (!vdpa)
+		return -ENODEV;
+
+	vdpa->pending_reply = true;
+	vdpa->pending.request = VHOST_GET_VRING_BASE;
+	vdpa->pending.payload.state.index = qid;
+	vdpa->pending.payload.state.num = vdpa->vring_info[qid].base;
+
+	return 0;
+}
+
+static int vhost_set_log_base(struct mdev_device *mdev, u64 *log_base)
+{
+	struct vdpa_dev *vdpa;
+
+	vdpa = mdev_get_drvdata(mdev);
+	if (!vdpa)
+		return -ENODEV;
+
+	vdpa->log_base = *log_base;
+	return 0;
+}
+
+static int vhost_set_features(struct mdev_device *mdev, u64 *features)
+{
+	struct vdpa_dev *vdpa;
+
+	vdpa =...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...+
+	vdpa = mdev_get_drvdata(mdev);
+	if (!vdpa)
+		return -ENODEV;
+
+	vdpa->pending_reply = true;
+	vdpa->pending.request = VHOST_GET_VRING_BASE;
+	vdpa->pending.payload.state.index = qid;
+	vdpa->pending.payload.state.num = vdpa->vring_info[qid].base;
+
+	return 0;
+}
+
+static int vhost_set_log_base(struct mdev_device *mdev, u64 *log_base)
+{
+	struct vdpa_dev *vdpa;
+
+	vdpa = mdev_get_drvdata(mdev);
+	if (!vdpa)
+		return -ENODEV;
+
+	vdpa->log_base = *log_base;
+	return 0;
+}
+
+static int vhost_set_features(struct mdev_device *mdev, u64 *features)
+{
+	struct vdpa_dev *vdpa;
+
+	vdpa =...
2019 Nov 07
2
[PATCH v6] vhost: introduce mdev based hardware backend
...then get the device fd with the device name. After getting
the device fd, userspace can use vhost ioctls on top of it
to setup the backend.
Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
---
This patch depends on below series:
https://lkml.org/lkml/2019/11/6/538
v5 -> v6:
- Filter out VHOST_SET_LOG_BASE/VHOST_SET_LOG_FD (Jason);
- Simplify len/off check (Jason);
- Address checkpatch warnings, some of them are ignored
  to keep the coding style consistent with existing ones;
v4 -> v5:
- Rebase on top of virtio-mdev series v8;
- Use the virtio_ops of mdev_device in vhost-mdev (Jason);
- Some min...
2023 Mar 28
1
[PATCH v6 11/11] vhost: allow userspace to create workers
...rker;
 	int (*msg_handler)(struct vhost_dev *dev, u32 asid,
 			   struct vhost_iotlb_msg *msg);
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index 92e1b700b51c..7329e7f349dd 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -45,6 +45,23 @@
 #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
 /* Specify an eventfd file descriptor to signal on log write. */
 #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
+/* By default, a device gets one vhost_worker that its virtqueues share. This
+ * command allows the owner of the device to create an additional...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...+		r = vhost_mdev_set_features(m, argp);
>>>> +		break;
>>>> +	case VHOST_MDEV_GET_VRING_NUM:
>>>> +		r = vhost_mdev_get_vring_num(m, argp);
>>>> +		break;
>>>> +	default:
>>>> +		/*
>>>> +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
>>>> +		 * VHOST_SET_LOG_FD are not used yet.
>>>> +		 */
>>>
>>> If we don't even use them, there's probably no need to call
>>> vhost_dev_ioctl(). This may help to avoid confusion when we want to develop
>>> new API for e.g...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...+		r = vhost_mdev_set_features(m, argp);
>>>> +		break;
>>>> +	case VHOST_MDEV_GET_VRING_NUM:
>>>> +		r = vhost_mdev_get_vring_num(m, argp);
>>>> +		break;
>>>> +	default:
>>>> +		/*
>>>> +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
>>>> +		 * VHOST_SET_LOG_FD are not used yet.
>>>> +		 */
>>>
>>> If we don't even use them, there's probably no need to call
>>> vhost_dev_ioctl(). This may help to avoid confusion when we want to develop
>>> new API for e.g...
2020 Feb 05
0
[PATCH] vhost: introduce vDPA based backend
...r = vhost_vdpa_get_features(v, argp);
> > +		break;
> > +	case VHOST_SET_FEATURES:
> > +		r = vhost_vdpa_set_features(v, argp);
> > +		break;
> > +	case VHOST_VDPA_GET_VRING_NUM:
> > +		r = vhost_vdpa_get_vring_num(v, argp);
> > +		break;
> > +	case VHOST_SET_LOG_BASE:
> > +	case VHOST_SET_LOG_FD:
> > +		r = -ENOIOCTLCMD;
> > +		break;
> > +	default:
> > +		mutex_lock(&v->vdev.mutex);
> > +		r = vhost_dev_ioctl(&v->vdev, cmd, argp);
> > +		if (r == -ENOIOCTLCMD)
> > +			r = vhost_vdpa_vring_ioctl(v, c...
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...gp);
+		break;
+	case VHOST_GET_FEATURES:
+		r = vhost_mdev_get_features(m, argp);
+		break;
+	case VHOST_SET_FEATURES:
+		r = vhost_mdev_set_features(m, argp);
+		break;
+	case VHOST_MDEV_GET_VRING_NUM:
+		r = vhost_mdev_get_vring_num(m, argp);
+		break;
+	default:
+		/*
+		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
+		 * VHOST_SET_LOG_FD are not used yet.
+		 */
+		r = vhost_dev_ioctl(&m->dev, cmd, argp);
+		if (r == -ENOIOCTLCMD)
+			r = vhost_mdev_vring_ioctl(m, cmd, argp);
+	}
+
+	mutex_unlock(&m->mutex);
+	return r;
+}
+
+static const struct vfio_device_ops vfio_vhost_mdev_dev_ops = {
+...
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...gp);
+		break;
+	case VHOST_GET_FEATURES:
+		r = vhost_mdev_get_features(m, argp);
+		break;
+	case VHOST_SET_FEATURES:
+		r = vhost_mdev_set_features(m, argp);
+		break;
+	case VHOST_MDEV_GET_VRING_NUM:
+		r = vhost_mdev_get_vring_num(m, argp);
+		break;
+	default:
+		/*
+		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
+		 * VHOST_SET_LOG_FD are not used yet.
+		 */
+		r = vhost_dev_ioctl(&m->dev, cmd, argp);
+		if (r == -ENOIOCTLCMD)
+			r = vhost_mdev_vring_ioctl(m, cmd, argp);
+	}
+
+	mutex_unlock(&m->mutex);
+	return r;
+}
+
+static const struct vfio_device_ops vfio_vhost_mdev_dev_ops = {
+...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
...gp);
+		break;
+	case VHOST_GET_FEATURES:
+		r = vhost_mdev_get_features(m, argp);
+		break;
+	case VHOST_SET_FEATURES:
+		r = vhost_mdev_set_features(m, argp);
+		break;
+	case VHOST_MDEV_GET_VRING_NUM:
+		r = vhost_mdev_get_vring_num(m, argp);
+		break;
+	default:
+		/*
+		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
+		 * VHOST_SET_LOG_FD are not used yet.
+		 */
+		r = vhost_dev_ioctl(&m->dev, cmd, argp);
+		if (r == -ENOIOCTLCMD)
+			r = vhost_mdev_vring_ioctl(m, cmd, argp);
+	}
+
+	mutex_unlock(&m->mutex);
+	return r;
+}
+
+static const struct vfio_device_ops vfio_vhost_mdev_dev_ops = {
+...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
...gp);
+		break;
+	case VHOST_GET_FEATURES:
+		r = vhost_mdev_get_features(m, argp);
+		break;
+	case VHOST_SET_FEATURES:
+		r = vhost_mdev_set_features(m, argp);
+		break;
+	case VHOST_MDEV_GET_VRING_NUM:
+		r = vhost_mdev_get_vring_num(m, argp);
+		break;
+	default:
+		/*
+		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
+		 * VHOST_SET_LOG_FD are not used yet.
+		 */
+		r = vhost_dev_ioctl(&m->dev, cmd, argp);
+		if (r == -ENOIOCTLCMD)
+			r = vhost_mdev_vring_ioctl(m, cmd, argp);
+	}
+
+	mutex_unlock(&m->mutex);
+	return r;
+}
+
+static const struct vfio_device_ops vfio_vhost_mdev_dev_ops = {
+...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...k;
> > +	case VHOST_SET_FEATURES:
> > +		r = vhost_mdev_set_features(m, argp);
> > +		break;
> > +	case VHOST_MDEV_GET_VRING_NUM:
> > +		r = vhost_mdev_get_vring_num(m, argp);
> > +		break;
> > +	default:
> > +		/*
> > +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
> > +		 * VHOST_SET_LOG_FD are not used yet.
> > +		 */
> 
> 
> If we don't even use them, there's probably no need to call
> vhost_dev_ioctl(). This may help to avoid confusion when we want to develop
> new API for e.g dirty page tracking.
Good point. It...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...k;
> > +	case VHOST_SET_FEATURES:
> > +		r = vhost_mdev_set_features(m, argp);
> > +		break;
> > +	case VHOST_MDEV_GET_VRING_NUM:
> > +		r = vhost_mdev_get_vring_num(m, argp);
> > +		break;
> > +	default:
> > +		/*
> > +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
> > +		 * VHOST_SET_LOG_FD are not used yet.
> > +		 */
> 
> 
> If we don't even use them, there's probably no need to call
> vhost_dev_ioctl(). This may help to avoid confusion when we want to develop
> new API for e.g dirty page tracking.
Good point. It...
2019 Oct 30
1
[PATCH v3] vhost: introduce mdev based hardware backend
...k;
> > +	case VHOST_SET_FEATURES:
> > +		r = vhost_mdev_set_features(m, argp);
> > +		break;
> > +	case VHOST_MDEV_GET_VRING_NUM:
> > +		r = vhost_mdev_get_vring_num(m, argp);
> > +		break;
> > +	default:
> > +		/*
> > +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
> > +		 * VHOST_SET_LOG_FD are not used yet.
> > +		 */
> > +		r = vhost_dev_ioctl(&m->dev, cmd, argp);
> > +		if (r == -ENOIOCTLCMD)
> > +			r = vhost_mdev_vring_ioctl(m, cmd, argp);
> > +	}
> > +
> > +	mutex_unlock(&m->mutex);
>...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...host_mdev_get_features(m, argp);
> +		break;
> +	case VHOST_SET_FEATURES:
> +		r = vhost_mdev_set_features(m, argp);
> +		break;
> +	case VHOST_MDEV_GET_VRING_NUM:
> +		r = vhost_mdev_get_vring_num(m, argp);
> +		break;
> +	default:
> +		/*
> +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
> +		 * VHOST_SET_LOG_FD are not used yet.
> +		 */
> +		r = vhost_dev_ioctl(&m->dev, cmd, argp);
> +		if (r == -ENOIOCTLCMD)
> +			r = vhost_mdev_vring_ioctl(m, cmd, argp);
> +	}
> +
> +	mutex_unlock(&m->mutex);
> +	return r;
> +}
> +
> +stati...
2019 Oct 30
0
[PATCH v3] vhost: introduce mdev based hardware backend
...host_mdev_get_features(m, argp);
> +		break;
> +	case VHOST_SET_FEATURES:
> +		r = vhost_mdev_set_features(m, argp);
> +		break;
> +	case VHOST_MDEV_GET_VRING_NUM:
> +		r = vhost_mdev_get_vring_num(m, argp);
> +		break;
> +	default:
> +		/*
> +		 * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE, and
> +		 * VHOST_SET_LOG_FD are not used yet.
> +		 */
> +		r = vhost_dev_ioctl(&m->dev, cmd, argp);
> +		if (r == -ENOIOCTLCMD)
> +			r = vhost_mdev_vring_ioctl(m, cmd, argp);
> +	}
> +
> +	mutex_unlock(&m->mutex);
> +	return r;
> +}
> +
> +stati...