search for: vhost_get_vring_endian

Displaying 20 results from an estimated 44 matches for "vhost_get_vring_endian".

2015 Apr 24
0
[PATCH v6 7/8] vhost: cross-endian support for legacy devices
...S_ENDIAN_LEGACY + bool "Cross-endian support for vhost" + default n + ---help--- + This option allows vhost to support guests with a different byte + ordering from host while using legacy virtio. + + Userspace programs can control the feature using the + VHOST_SET_VRING_ENDIAN and VHOST_GET_VRING_ENDIAN ioctls. + + This is only useful on a few platforms (ppc64 and arm64). Since it + adds some overhead, it is disabled by default. + + If unsure, say "N". diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2ee2826..9e8e004 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/...
2015 Apr 23
0
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
...host. + +config VHOST_CROSS_ENDIAN_LEGACY + bool "Cross-endian support for vhost" + default n + ---help--- + This option allows vhost to support guests with a different byte + ordering from host. + + Userspace programs can control the feature using the + VHOST_SET_VRING_ENDIAN and VHOST_GET_VRING_ENDIAN ioctls. + + This is only useful on a few platforms (ppc64 and arm64). Since it + adds some overhead, it is disabled default. + + If unsure, say "N". diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2ee2826..8c4390d 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vho...
2015 Apr 24
2
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
...llows vhost to support guests with a different byte > + ordering from host. "...while using legacy virtio." Might help to explain the "LEGACY" in the config option ;) > + > + Userspace programs can control the feature using the > + VHOST_SET_VRING_ENDIAN and VHOST_GET_VRING_ENDIAN ioctls. > + > + This is only useful on a few platforms (ppc64 and arm64). Since it > + adds some overhead, it is disabled default. s/default/by default/ > + > + If unsure, say "N". > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 2ee2826..8...
2015 Apr 24
2
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
...llows vhost to support guests with a different byte > + ordering from host. "...while using legacy virtio." Might help to explain the "LEGACY" in the config option ;) > + > + Userspace programs can control the feature using the > + VHOST_SET_VRING_ENDIAN and VHOST_GET_VRING_ENDIAN ioctls. > + > + This is only useful on a few platforms (ppc64 and arm64). Since it > + adds some overhead, it is disabled default. s/default/by default/ > + > + If unsure, say "N". > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 2ee2826..8...
2015 Apr 24
0
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
...dering from host. > > "...while using legacy virtio." > > Might help to explain the "LEGACY" in the config option ;) > Makes sense indeed ! > > + > > + Userspace programs can control the feature using the > > + VHOST_SET_VRING_ENDIAN and VHOST_GET_VRING_ENDIAN ioctls. > > + > > + This is only useful on a few platforms (ppc64 and arm64). Since it > > + adds some overhead, it is disabled default. > > s/default/by default/ > Ok. > > + > > + If unsure, say "N". > > diff --git a/drivers/vhost/vh...
2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...@@ static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) > s.num != VHOST_VRING_BIG_ENDIAN) > return -EINVAL; > > - vq->user_be = s.num; > + vhost_enable_user_be(vq, !!s.num); > > return 0; > } > @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, > return 0; > } > > -static void vhost_init_is_le(struct vhost_virtqueue *vq) > +static void vhost_enable_is_le(struct vhost_virtqueue *vq) > { > /* Note for legacy virtio: user_be is initialized at reset time > * according to...
2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...@@ static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) > s.num != VHOST_VRING_BIG_ENDIAN) > return -EINVAL; > > - vq->user_be = s.num; > + vhost_enable_user_be(vq, !!s.num); > > return 0; > } > @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, > return 0; > } > > -static void vhost_init_is_le(struct vhost_virtqueue *vq) > +static void vhost_enable_is_le(struct vhost_virtqueue *vq) > { > /* Note for legacy virtio: user_be is initialized at reset time > * according to...
2016 Feb 10
1
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...> > s.num != VHOST_VRING_BIG_ENDIAN) > > > return -EINVAL; > > > > > > - vq->user_be = s.num; > > > + vhost_enable_user_be(vq, !!s.num); > > > > > > return 0; > > > } > > > @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, > > > return 0; > > > } > > > > > > -static void vhost_init_is_le(struct vhost_virtqueue *vq) > > > +static void vhost_enable_is_le(struct vhost_virtqueue *vq) > > > { > > > /* Note for legac...
2016 Feb 10
1
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...> > s.num != VHOST_VRING_BIG_ENDIAN) > > > return -EINVAL; > > > > > > - vq->user_be = s.num; > > > + vhost_enable_user_be(vq, !!s.num); > > > > > > return 0; > > > } > > > @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, > > > return 0; > > > } > > > > > > -static void vhost_init_is_le(struct vhost_virtqueue *vq) > > > +static void vhost_enable_is_le(struct vhost_virtqueue *vq) > > > { > > > /* Note for legac...
2015 Apr 23
16
[PATCH v5 0/8] 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 compatible with modern virtio and can be fully compiled out through kernel config. FWIW, I could flawlessly kexec/reboot guests from ppc64 to ppc64le and back. I could also migrate from a ppc64 to a ppc64le host and back. No regressions on x86 as expected. My experimental QEMU tree
2015 Apr 23
16
[PATCH v5 0/8] 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 compatible with modern virtio and can be fully compiled out through kernel config. FWIW, I could flawlessly kexec/reboot guests from ppc64 to ppc64le and back. I could also migrate from a ppc64 to a ppc64le host and back. No regressions on x86 as expected. My experimental QEMU tree
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
...This is a follow up patch. --- drivers/vhost/vhost.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index d643260..8f99fe0 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -130,14 +130,14 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, static void vhost_init_is_le(struct vhost_virtqueue *vq) { - if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) - vq->is_le = true; + vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1) + || virtio_legacy_is_little_endian(); } #endif /* CONFIG_VHOST_...
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
...This is a follow up patch. --- drivers/vhost/vhost.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index d643260..8f99fe0 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -130,14 +130,14 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, static void vhost_init_is_le(struct vhost_virtqueue *vq) { - if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) - vq->is_le = true; + vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1) + || virtio_legacy_is_little_endian(); } #endif /* CONFIG_VHOST_...
2016 Jan 13
0
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...struct vhost_vring_state s; @@ -62,7 +67,7 @@ static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) s.num != VHOST_VRING_BIG_ENDIAN) return -EINVAL; - vq->user_be = s.num; + vhost_enable_user_be(vq, !!s.num); return 0; } @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, return 0; } -static void vhost_init_is_le(struct vhost_virtqueue *vq) +static void vhost_enable_is_le(struct vhost_virtqueue *vq) { /* Note for legacy virtio: user_be is initialized at reset time * according to the host endianness. If userspace does n...
2016 Feb 10
0
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...vhost_virtqueue *vq, int __user *argp) > > s.num != VHOST_VRING_BIG_ENDIAN) > > return -EINVAL; > > > > - vq->user_be = s.num; > > + vhost_enable_user_be(vq, !!s.num); > > > > return 0; > > } > > @@ -81,7 +86,7 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, > > return 0; > > } > > > > -static void vhost_init_is_le(struct vhost_virtqueue *vq) > > +static void vhost_enable_is_le(struct vhost_virtqueue *vq) > > { > > /* Note for legacy virtio: user_be is initialized at...
2016 Feb 26
0
[PATCH V3 3/3] vhost_net: basic polling support
...uct vhost_dev *dev, vq->memory = NULL; vq->is_le = virtio_legacy_is_little_endian(); vhost_vq_reset_user_be(vq); + vq->busyloop_timeout = 0; } static int vhost_worker(void *data) @@ -919,6 +920,19 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp) case VHOST_GET_VRING_ENDIAN: r = vhost_get_vring_endian(vq, idx, argp); break; + case VHOST_SET_VRING_BUSYLOOP_TIMEOUT: + if (copy_from_user(&s, argp, sizeof(s))) { + r = -EFAULT; + break; + } + vq->busyloop_timeout = s.num; + break; + case VHOST_GET_VRING_BUSYLOOP_TIMEOUT: + s.index = idx; + s.num = vq...
2015 Dec 01
0
[PATCH V2 3/3] vhost_net: basic polling support
...t vhost_dev *d, int ioctl, void __user *argp) struct vhost_vring_state s; struct vhost_vring_file f; struct vhost_vring_addr a; + struct vhost_vring_busyloop_timeout t; u32 idx; long r; @@ -919,6 +921,19 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp) case VHOST_GET_VRING_ENDIAN: r = vhost_get_vring_endian(vq, idx, argp); break; + case VHOST_SET_VRING_BUSYLOOP_TIMEOUT: + if (copy_from_user(&t, argp, sizeof(t))) { + r = -EFAULT; + break; + } + vq->busyloop_timeout = t.timeout; + break; + case VHOST_GET_VRING_BUSYLOOP_TIMEOUT: + t.index = idx; + t.time...
2016 Jan 13
7
[PATCH 0/2] vhost: cross-endian code cleanup
This series is a respin of the following patch: http://patchwork.ozlabs.org/patch/565921/ Patch 1 is preliminary work: it gives better names to the helpers that are involved in cross-endian support. Patch 2 is actually a v2 of the original patch. All devices now call a helper in the generic code, which DTRT according to vq->private_data, as suggested by Michael. --- Greg Kurz (2):
2016 Jan 13
7
[PATCH 0/2] vhost: cross-endian code cleanup
This series is a respin of the following patch: http://patchwork.ozlabs.org/patch/565921/ Patch 1 is preliminary work: it gives better names to the helpers that are involved in cross-endian support. Patch 2 is actually a v2 of the original patch. All devices now call a helper in the generic code, which DTRT according to vq->private_data, as suggested by Michael. --- Greg Kurz (2):
2016 Jan 20
3
[PATCH V2 3/3] vhost_net: basic polling support
...> struct vhost_vring_state s; > struct vhost_vring_file f; > struct vhost_vring_addr a; > + struct vhost_vring_busyloop_timeout t; > u32 idx; > long r; > > @@ -919,6 +921,19 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp) > case VHOST_GET_VRING_ENDIAN: > r = vhost_get_vring_endian(vq, idx, argp); > break; > + case VHOST_SET_VRING_BUSYLOOP_TIMEOUT: > + if (copy_from_user(&t, argp, sizeof(t))) { > + r = -EFAULT; > + break; > + } > + vq->busyloop_timeout = t.timeout; > + break; > + case VHOST_GET_V...