Displaying 20 results from an estimated 23 matches for "vhost_set_vring_endian_legacy".
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...ndian = virtio_legacy_is_little_endian();
> }
>
> static int vhost_worker(void *data)
> @@ -630,6 +631,54 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
> return 0;
> }
>
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
EINVAL probably makes more sense? But I'm not sure this
is helpful: one can set VIRTIO_F_VERSION_1 afterwar...
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...ndian = virtio_legacy_is_little_endian();
> }
>
> static int vhost_worker(void *data)
> @@ -630,6 +631,54 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
> return 0;
> }
>
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
EINVAL probably makes more sense? But I'm not sure this
is helpful: one can set VIRTIO_F_VERSION_1 afterwar...
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...ndian = virtio_legacy_is_little_endian();
> }
>
> static int vhost_worker(void *data)
> @@ -630,6 +631,54 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
> return 0;
> }
>
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
> +
> + if (copy_from_user(&s, argp, sizeof(s)))
> + return -EFAULT;
> +
> + vq->legacy_i...
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...ndian = virtio_legacy_is_little_endian();
> }
>
> static int vhost_worker(void *data)
> @@ -630,6 +631,54 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
> return 0;
> }
>
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
> +
> + if (copy_from_user(&s, argp, sizeof(s)))
> + return -EFAULT;
> +
> + vq->legacy_i...
2015 Apr 07
0
[PATCH v3 7/7] vhost: feature to set the vring endianness
...gt;memory = NULL;
+ vq->legacy_is_little_endian = virtio_legacy_is_little_endian();
}
static int vhost_worker(void *data)
@@ -630,6 +631,54 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m)
return 0;
}
+#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
+static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
+ void __user *argp)
+{
+ struct vhost_vring_state s;
+
+ if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
+ return -EPERM;
+
+ if (copy_from_user(&s, argp, sizeof(s)))
+ return -EFAULT;
+
+ vq->legacy_is_little_endian = !!s.num;
+ return 0;
+}
+
+static lon...
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...; drivers/vhost/vhost.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
> drivers/vhost/vhost.h | 17 +++++++++++++-
> include/uapi/linux/vhost.h | 5 ++++
> 4 files changed, 86 insertions(+), 1 deletion(-)
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
> +
> + if (copy_from_user(&s, argp, sizeof(s)))
> + return -EFAULT;
> +
> + vq->legacy_i...
2015 Apr 07
1
[PATCH v3 7/7] vhost: feature to set the vring endianness
...; drivers/vhost/vhost.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
> drivers/vhost/vhost.h | 17 +++++++++++++-
> include/uapi/linux/vhost.h | 5 ++++
> 4 files changed, 86 insertions(+), 1 deletion(-)
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> +static long vhost_set_vring_endian_legacy(struct vhost_virtqueue *vq,
> + void __user *argp)
> +{
> + struct vhost_vring_state s;
> +
> + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
> + return -EPERM;
> +
> + if (copy_from_user(&s, argp, sizeof(s)))
> + return -EFAULT;
> +
> + vq->legacy_i...
2015 Apr 07
13
[PATCH v3 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness.
Patches 1-6 remain the same as the previous post. Patch 7 was heavily changed
according to MST's comments.
---
Greg Kurz (7):
virtio: introduce virtio_is_little_endian() helper
tun: add tun_is_little_endian() helper
macvtap: introduce macvtap_is_little_endian()
2015 Apr 07
13
[PATCH v3 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness.
Patches 1-6 remain the same as the previous post. Patch 7 was heavily changed
according to MST's comments.
---
Greg Kurz (7):
virtio: introduce virtio_is_little_endian() helper
tun: add tun_is_little_endian() helper
macvtap: introduce macvtap_is_little_endian()
2015 Apr 02
2
[PATCH v2 7/7] vhost: feature to set the vring endianness
...>legacy_big_endian = false;
> }
>
> static int vhost_worker(void *data)
> @@ -806,6 +807,24 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp)
> } else
> filep = eventfp;
> break;
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> + case VHOST_SET_VRING_ENDIAN_LEGACY:
> + {
> + struct vhost_vring_endian e;
> +
> + if (!vhost_has_feature(vq, VHOST_F_SET_ENDIAN_LEGACY)) {
> + r = -EINVAL;
> + break;
> + }
> +
> + if (copy_from_user(&e, argp, sizeof(e))) {
> + r = -EFAULT;
> + break;
> + }
> + vq->legacy_...
2015 Apr 02
2
[PATCH v2 7/7] vhost: feature to set the vring endianness
...>legacy_big_endian = false;
> }
>
> static int vhost_worker(void *data)
> @@ -806,6 +807,24 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp)
> } else
> filep = eventfp;
> break;
> +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> + case VHOST_SET_VRING_ENDIAN_LEGACY:
> + {
> + struct vhost_vring_endian e;
> +
> + if (!vhost_has_feature(vq, VHOST_F_SET_ENDIAN_LEGACY)) {
> + r = -EINVAL;
> + break;
> + }
> +
> + if (copy_from_user(&e, argp, sizeof(e))) {
> + r = -EFAULT;
> + break;
> + }
> + vq->legacy_...
2015 Apr 02
0
[PATCH v2 7/7] vhost: feature to set the vring endianness
...gt; >
> > static int vhost_worker(void *data)
> > @@ -806,6 +807,24 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp)
> > } else
> > filep = eventfp;
> > break;
> > +#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
> > + case VHOST_SET_VRING_ENDIAN_LEGACY:
> > + {
> > + struct vhost_vring_endian e;
> > +
> > + if (!vhost_has_feature(vq, VHOST_F_SET_ENDIAN_LEGACY)) {
> > + r = -EINVAL;
> > + break;
> > + }
> > +
> > + if (copy_from_user(&e, argp, sizeof(e))) {
> > + r = -EFAULT...
2015 Apr 02
0
[PATCH v2 7/7] vhost: feature to set the vring endianness
...log_ctx = NULL;
vq->memory = NULL;
+ vq->legacy_big_endian = false;
}
static int vhost_worker(void *data)
@@ -806,6 +807,24 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp)
} else
filep = eventfp;
break;
+#ifdef CONFIG_VHOST_SET_ENDIAN_LEGACY
+ case VHOST_SET_VRING_ENDIAN_LEGACY:
+ {
+ struct vhost_vring_endian e;
+
+ if (!vhost_has_feature(vq, VHOST_F_SET_ENDIAN_LEGACY)) {
+ r = -EINVAL;
+ break;
+ }
+
+ if (copy_from_user(&e, argp, sizeof(e))) {
+ r = -EFAULT;
+ break;
+ }
+ vq->legacy_big_endian = e.is_big_endian;
+ break;
+ }
+#endif
default:...
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness. It is a complete rework of my initial post.
Patches 1 to 5 are preliminary work: we move the endianness check out of all
memory accessors to separate functions.
Patch 6 changes the semantics of the accessors so that they have explicit big
endian support.
Patch 7 brings the cross-endian
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness. It is a complete rework of my initial post.
Patches 1 to 5 are preliminary work: we move the endianness check out of all
memory accessors to separate functions.
Patch 6 changes the semantics of the accessors so that they have explicit big
endian support.
Patch 7 brings the cross-endian
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
.../Kconfig | 10 ++++++
> drivers/vhost/vhost.c | 76 +++++++++++++++++++++++++++++++++++++++++++-
> drivers/vhost/vhost.h | 12 +++++--
> include/uapi/linux/vhost.h | 9 +++++
> 4 files changed, 103 insertions(+), 4 deletions(-)
>
> Changes since v3:
> - VHOST_SET_VRING_ENDIAN_LEGACY ioctl renamed to VHOST_SET_VRING_BIG_ENDIAN
> - ioctl API is now: 0 for le, 1 for be, other values are EINVAL
> - ioctl doesn't filter out modern devices
> - ioctl stubs return ENOIOCTLCMD
> - forbid endianness changes when vring is active
> - logic now handled with vq->is_le...
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
.../Kconfig | 10 ++++++
> drivers/vhost/vhost.c | 76 +++++++++++++++++++++++++++++++++++++++++++-
> drivers/vhost/vhost.h | 12 +++++--
> include/uapi/linux/vhost.h | 9 +++++
> 4 files changed, 103 insertions(+), 4 deletions(-)
>
> Changes since v3:
> - VHOST_SET_VRING_ENDIAN_LEGACY ioctl renamed to VHOST_SET_VRING_BIG_ENDIAN
> - ioctl API is now: 0 for le, 1 for be, other values are EINVAL
> - ioctl doesn't filter out modern devices
> - ioctl stubs return ENOIOCTLCMD
> - forbid endianness changes when vring is active
> - logic now handled with vq->is_le...
2015 Apr 10
0
[PATCH v4 7/8] vhost: feature to set the vring endianness
...vnet.ibm.com>
---
drivers/vhost/Kconfig | 10 ++++++
drivers/vhost/vhost.c | 76 +++++++++++++++++++++++++++++++++++++++++++-
drivers/vhost/vhost.h | 12 +++++--
include/uapi/linux/vhost.h | 9 +++++
4 files changed, 103 insertions(+), 4 deletions(-)
Changes since v3:
- VHOST_SET_VRING_ENDIAN_LEGACY ioctl renamed to VHOST_SET_VRING_BIG_ENDIAN
- ioctl API is now: 0 for le, 1 for be, other values are EINVAL
- ioctl doesn't filter out modern devices
- ioctl stubs return ENOIOCTLCMD
- forbid endianness changes when vring is active
- logic now handled with vq->is_le and vq->user_be accord...
2015 Apr 21
0
[PATCH v4 7/8] vhost: feature to set the vring endianness
...t; drivers/vhost/vhost.c | 76 +++++++++++++++++++++++++++++++++++++++++++-
> > drivers/vhost/vhost.h | 12 +++++--
> > include/uapi/linux/vhost.h | 9 +++++
> > 4 files changed, 103 insertions(+), 4 deletions(-)
> >
> > Changes since v3:
> > - VHOST_SET_VRING_ENDIAN_LEGACY ioctl renamed to VHOST_SET_VRING_BIG_ENDIAN
> > - ioctl API is now: 0 for le, 1 for be, other values are EINVAL
> > - ioctl doesn't filter out modern devices
> > - ioctl stubs return ENOIOCTLCMD
> > - forbid endianness changes when vring is active
> > - logic now h...
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
...| 76 +++++++++++++++++++++++++++++++++++++++++++-
> > > drivers/vhost/vhost.h | 12 +++++--
> > > include/uapi/linux/vhost.h | 9 +++++
> > > 4 files changed, 103 insertions(+), 4 deletions(-)
> > >
> > > Changes since v3:
> > > - VHOST_SET_VRING_ENDIAN_LEGACY ioctl renamed to VHOST_SET_VRING_BIG_ENDIAN
> > > - ioctl API is now: 0 for le, 1 for be, other values are EINVAL
> > > - ioctl doesn't filter out modern devices
> > > - ioctl stubs return ENOIOCTLCMD
> > > - forbid endianness changes when vring is active
>...