Displaying 20 results from an estimated 27 matches for "vhost_rpmsg_copy".
2020 May 16
0
[PATCH RFC] vhost: add an SOF Audio DSP driver
...a_req req;
+ size_t len = vhost_rpmsg_iter_len(iter);
+ size_t nbytes;
+
+ if (len < sizeof(req)) {
+ vq_err(vq, "%s(): data count %zu too small\n",
+ __func__, len);
+ return -EINVAL;
+ }
+
+ /* copy_{to,from}_iter() can be called repeatedly to continue copying */
+ nbytes = vhost_rpmsg_copy(vr, iter, &req, sizeof(req));
+ if (nbytes != sizeof(req)) {
+ vq_err(vq,
+ "%s(): got %zu instead of %zu bytes of data header\n",
+ __func__, nbytes, sizeof(req));
+ return -EIO;
+ }
+
+ len -= nbytes;
+
+ /* Get a pointer to copy data to or from the audio buffer */...
2020 Sep 10
0
[PATCH v7 3/3] vhost: add an RPMsg API
...iter);
+ if (ret < 0)
+ goto return_buf;
+ }
+
+ break;
+ }
+
+ return 0;
+
+return_buf:
+ vhost_add_used(vq, iter->head, 0);
+unlock:
+ vhost_enable_notify(&vr->dev, vq);
+ mutex_unlock(&vq->mutex);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
+
+size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
+ void *data, size_t size)
+{
+ /*
+ * We could check for excess data, but copy_{to,from}_iter() don't do
+ * that either
+ */
+ if (iter->vq == vr->vq + VIRTIO_RPMSG_RESPONSE)
+ return copy_to_iter(data, size, &iter->iov...
2020 May 27
0
[PATCH v3 5/5] vhost: add an RPMsg API
...+
+return_buf:
+ /*
+ * FIXME: vhost_discard_vq_desc() or vhost_add_used(), see comment in
+ * vhost_rpmsg_get_single()
+ */
+unlock:
+ vhost_enable_notify(&vr->dev, vq);
+ mutex_unlock(&vq->mutex);
+
+ return iter->head;
+}
+EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
+
+size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
+ void *data, size_t size)
+{
+ /*
+ * We could check for excess data, but copy_{to,from}_iter() don't do
+ * that either
+ */
+ if (iter->vq == vr->vq + VIRTIO_RPMSG_RESPONSE)
+ return copy_to_iter(data, size, &iter->iov...
2020 Jul 22
0
[PATCH v4 4/4] vhost: add an RPMsg API
...+
+return_buf:
+ /*
+ * FIXME: vhost_discard_vq_desc() or vhost_add_used(), see comment in
+ * vhost_rpmsg_get_single()
+ */
+unlock:
+ vhost_enable_notify(&vr->dev, vq);
+ mutex_unlock(&vq->mutex);
+
+ return iter->head;
+}
+EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
+
+size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
+ void *data, size_t size)
+{
+ /*
+ * We could check for excess data, but copy_{to,from}_iter() don't do
+ * that either
+ */
+ if (iter->vq == vr->vq + VIRTIO_RPMSG_RESPONSE)
+ return copy_to_iter(data, size, &iter->iov...
2020 May 27
0
[PATCH v2 5/5] vhost: add an RPMsg API
...Thanks,
> Mathieu
>
> > + int ret = vhost_rpmsg_start_lock(vr, &iter, VIRTIO_RPMSG_RESPONSE,
> > + sizeof(ns));
> > +
> > + if (ret < 0)
> > + return ret;
> > +
> > + strlcpy(ns.name, name, sizeof(ns.name));
> > +
> > + ret = vhost_rpmsg_copy(vr, &iter, &ns, sizeof(ns));
> > + if (ret != sizeof(ns))
> > + vq_err(iter.vq, "%s(): added %d instead of %zu bytes\n",
> > + __func__, ret, sizeof(ns));
> > +
> > + ret = vhost_rpmsg_finish_unlock(vr, &iter);
> > + if (ret < 0)...
2020 Sep 10
0
[PATCH v5 4/4] vhost: add an RPMsg API
...gt; > + vhost_add_used(vq, iter->head, 0);
> > +unlock:
> > + vhost_enable_notify(&vr->dev, vq);
> > + mutex_unlock(&vq->mutex);
> > +
> > + return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
> > +
> > +size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
> > + void *data, size_t size)
> > +{
> > + /*
> > + * We could check for excess data, but copy_{to,from}_iter() don't do
> > + * that either
> > + */
> > + if (iter->vq == vr->vq + VIRTI...
2020 May 25
6
[PATCH v2 0/5] Add a vhost RPMsg API
v2:
- remove "default n" from Kconfig
- drop patch #6 - it depends on a different patch, that is currently
an RFC
- update patch #5 with a correct vhost_dev_init() prototype
Linux supports RPMsg over VirtIO for "remote processor" /AMP use
cases. It can however also be used for virtualisation scenarios,
e.g. when using KVM to run Linux on both the host and the guests.
This
2020 Sep 18
0
[PATCH v7 3/3] vhost: add an RPMsg API
...gt; > + vhost_add_used(vq, iter->head, 0);
> > +unlock:
> > + vhost_enable_notify(&vr->dev, vq);
> > + mutex_unlock(&vq->mutex);
> > +
> > + return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
> > +
> > +size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
> > + void *data, size_t size)
> > +{
> > + /*
> > + * We could check for excess data, but copy_{to,from}_iter() don't do
> > + * that either
> > + */
> > + if (iter->vq == vr->vq + VIRTI...
2020 Sep 10
6
[PATCH v7 0/3] Add a vhost RPMsg API
Hi,
Next update:
v7:
- remove documentation update to be send separately
- address comments from Mathieu Poirier (thanks)
v6:
- rename include/linux/virtio_rpmsg.h -> include/linux/rpmsg/virtio.h
v5:
- don't hard-code message layout
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
2020 Sep 10
6
[PATCH v7 0/3] Add a vhost RPMsg API
Hi,
Next update:
v7:
- remove documentation update to be send separately
- address comments from Mathieu Poirier (thanks)
v6:
- rename include/linux/virtio_rpmsg.h -> include/linux/rpmsg/virtio.h
v5:
- don't hard-code message layout
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
2020 Aug 26
12
[PATCH v5 0/4] Add a vhost RPMsg API
Hi,
Next update:
v5:
- don't hard-code message layout
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
- update patch #5 with a correct vhost_dev_init() prototype
- drop patch #6 - it depends on a different patch, that is currently
an RFC
- address comments from Pierre-Louis Bossart:
2020 Aug 26
12
[PATCH v5 0/4] Add a vhost RPMsg API
Hi,
Next update:
v5:
- don't hard-code message layout
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
- update patch #5 with a correct vhost_dev_init() prototype
- drop patch #6 - it depends on a different patch, that is currently
an RFC
- address comments from Pierre-Louis Bossart:
2020 Aug 04
2
[PATCH v4 4/4] vhost: add an RPMsg API
...+ * vhost_rpmsg_get_single()
> + */
What's to be done with this FIXME?
> +unlock:
> + vhost_enable_notify(&vr->dev, vq);
> + mutex_unlock(&vq->mutex);
> +
> + return iter->head;
> +}
> +EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
> +
> +size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
> + void *data, size_t size)
> +{
> + /*
> + * We could check for excess data, but copy_{to,from}_iter() don't do
> + * that either
> + */
> + if (iter->vq == vr->vq + VIRTIO_RPMSG_RESPONSE)
> + return co...
2020 Aug 04
2
[PATCH v4 4/4] vhost: add an RPMsg API
...+ * vhost_rpmsg_get_single()
> + */
What's to be done with this FIXME?
> +unlock:
> + vhost_enable_notify(&vr->dev, vq);
> + mutex_unlock(&vq->mutex);
> +
> + return iter->head;
> +}
> +EXPORT_SYMBOL_GPL(vhost_rpmsg_start_lock);
> +
> +size_t vhost_rpmsg_copy(struct vhost_rpmsg *vr, struct vhost_rpmsg_iter *iter,
> + void *data, size_t size)
> +{
> + /*
> + * We could check for excess data, but copy_{to,from}_iter() don't do
> + * that either
> + */
> + if (iter->vq == vr->vq + VIRTIO_RPMSG_RESPONSE)
> + return co...
2020 May 25
0
[Sound-open-firmware] [PATCH RFC] vhost: add an SOF Audio DSP driver
...t; > + return ret;
> > +}
>
> [...]
>
> > +static ssize_t vhost_dsp_ipc_write(struct vhost_rpmsg *vr,
> > + struct vhost_rpmsg_iter *iter)
> > +{
> > + struct vhost_dsp *dsp = container_of(vr, struct vhost_dsp, vrdev);
> > +
> > + return vhost_rpmsg_copy(vr, iter, dsp->reply_buf,
> > + vhost_rpmsg_iter_len(iter)) ==
> > + vhost_rpmsg_iter_len(iter) ? 0 : -EIO;
> > +}
>
> This is rather convoluted code, with the same function called on both sides
> of a comparison.
It's a simple inline function, but sure, I ca...
2020 Jul 22
13
[PATCH v4 0/4] Add a vhost RPMsg API
Hi,
Now that virtio-rpmsg endianness fixes have been merged we can
proceed with the next step.
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
- update patch #5 with a correct vhost_dev_init() prototype
- drop patch #6 - it depends on a different patch, that is currently
an RFC
-
2020 Jul 22
13
[PATCH v4 0/4] Add a vhost RPMsg API
Hi,
Now that virtio-rpmsg endianness fixes have been merged we can
proceed with the next step.
v4:
- add endianness conversions to comply with the VirtIO standard
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
- update patch #5 with a correct vhost_dev_init() prototype
- drop patch #6 - it depends on a different patch, that is currently
an RFC
-
2020 May 16
9
[PATCH 0/6] Add a vhost RPMsg API
Linux supports RPMsg over VirtIO for "remote processor" /AMP use
cases. It can however also be used for virtualisation scenarios,
e.g. when using KVM to run Linux on both the host and the guests.
This patch set adds a wrapper API to facilitate writing vhost
drivers for such RPMsg-based solutions. The first use case is an
audio DSP virtualisation project, currently under development,
2020 May 16
9
[PATCH 0/6] Add a vhost RPMsg API
Linux supports RPMsg over VirtIO for "remote processor" /AMP use
cases. It can however also be used for virtualisation scenarios,
e.g. when using KVM to run Linux on both the host and the guests.
This patch set adds a wrapper API to facilitate writing vhost
drivers for such RPMsg-based solutions. The first use case is an
audio DSP virtualisation project, currently under development,
2020 May 27
10
[PATCH v3 0/5] Add a vhost RPMsg API
v3:
- address several checkpatch warnings
- address comments from Mathieu Poirier
v2:
- update patch #5 with a correct vhost_dev_init() prototype
- drop patch #6 - it depends on a different patch, that is currently
an RFC
- address comments from Pierre-Louis Bossart:
* remove "default n" from Kconfig
Linux supports RPMsg over VirtIO for "remote processor" /AMP use
cases.