search for: config_vhost_cross_endian_legacy

Displaying 20 results from an estimated 93 matches for "config_vhost_cross_endian_legacy".

2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...s/vhost/vhost.c b/drivers/vhost/vhost.c > index ad2146a9ab2d..e02e06755ab7 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -43,11 +43,16 @@ enum { > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > { > vq->user_be = !virtio_legacy_is_little_endian(); > } > Hmm this doesn't look like an improvement to me. What does it mean to disab...
2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...s/vhost/vhost.c b/drivers/vhost/vhost.c > index ad2146a9ab2d..e02e06755ab7 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -43,11 +43,16 @@ enum { > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > { > vq->user_be = !virtio_legacy_is_little_endian(); > } > Hmm this doesn't look like an improvement to me. What does it mean to disab...
2016 Feb 10
1
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...b2d..e02e06755ab7 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -43,11 +43,16 @@ enum { > > > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > > > > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > > > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > > > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > > > { > > > vq->user_be = !virtio_legacy_is_little_endian(); > > > } > > > > > > &g...
2016 Feb 10
1
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...b2d..e02e06755ab7 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -43,11 +43,16 @@ enum { > > > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > > > > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > > > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > > > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > > > { > > > vq->user_be = !virtio_legacy_is_little_endian(); > > > } > > > > > > &g...
2015 Apr 24
0
[PATCH v6 7/8] vhost: cross-endian support for legacy devices
...2ee2826..9e8e004 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -36,6 +36,77 @@ enum { #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY +static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) +{ + vq->user_be = !virtio_legacy_is_little_endian(); +} + +static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) +{ + struct vhost_vring_state s; + + if (vq->private_data) + return -EBUSY; + + if (cop...
2015 Apr 23
0
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
...2ee2826..8c4390d 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -36,6 +36,78 @@ enum { #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY +static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) +{ + vq->user_be = !virtio_legacy_is_little_endian(); +} + +static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) +{ + struct vhost_vring_state s; + + if (vq->private_data) + return -EBUSY; + + if (cop...
2015 Apr 24
2
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
.../drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -36,6 +36,78 @@ enum { > #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > +static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > +{ > + vq->user_be = !virtio_legacy_is_little_endian(); > +} > + > +static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) > +{ > + struct vhost_vring_state s; > + > + if (...
2015 Apr 24
2
[PATCH v5 7/8] vhost: cross-endian support for legacy devices
.../drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -36,6 +36,78 @@ enum { > #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > +static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > +{ > + vq->user_be = !virtio_legacy_is_little_endian(); > +} > + > +static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) > +{ > + struct vhost_vring_state s; > + > + if (...
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
..._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_CROSS_ENDIAN_LEGACY */ static void vhost_reset_is_le(struct vhost_virtqueue *vq) { - vq->is_le = virtio_legacy_is_little_endian(); + vhost_init_is_le(vq); } struct vhost_flush_struct { @@ -1714,10 +1714,8 @@ int vhost_vq_init_access(struct vhost_virtqueue *vq) int r; bool is_le = vq->is_le; - if (!...
2017 Jan 30
3
[PATCH] vhost: fix initialization for vq->is_le
..._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_CROSS_ENDIAN_LEGACY */ static void vhost_reset_is_le(struct vhost_virtqueue *vq) { - vq->is_le = virtio_legacy_is_little_endian(); + vhost_init_is_le(vq); } struct vhost_flush_struct { @@ -1714,10 +1714,8 @@ int vhost_vq_init_access(struct vhost_virtqueue *vq) int r; bool is_le = vq->is_le; - if (!...
2016 Jan 13
0
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...9 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index ad2146a9ab2d..e02e06755ab7 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -43,11 +43,16 @@ enum { #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) +static void vhost_disable_user_be(struct vhost_virtqueue *vq) { vq->user_be = !virtio_legacy_is_little_endian(); } +static void vhost_enable_user_be(struct vhost_virtqueue *vq, bool user_be) +{ + vq->user_be = user_be; +}...
2017 Jan 27
2
[BUG/RFC] vhost: net: big endian viring access despite virtio 1
...; > I think you do need to reset it, just maybe within vhost_init_is_le. > > if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) > vq->is_le = true; > else > vhost_reset_is_le(vq); > > That is a very good point! I have overlooked that while the CONFIG_VHOST_CROSS_ENDIAN_LEGACY variant static void vhost_init_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 not set an * explicit endianness, the default behavior is native endian, as *...
2017 Jan 27
2
[BUG/RFC] vhost: net: big endian viring access despite virtio 1
...; > I think you do need to reset it, just maybe within vhost_init_is_le. > > if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) > vq->is_le = true; > else > vhost_reset_is_le(vq); > > That is a very good point! I have overlooked that while the CONFIG_VHOST_CROSS_ENDIAN_LEGACY variant static void vhost_init_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 not set an * explicit endianness, the default behavior is native endian, as *...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...umem; - struct vhost_umem *iotlb; - void *private_data; - u64 acked_features; - /* Log write descriptors */ - void __user *log_base; - struct vhost_log *log; - - /* Ring endianness. Defaults to legacy native endianness. - * Set to true when starting a modern virtio device. */ - bool is_le; -#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY - /* Ring endianness requested by userspace for cross-endian support. */ - bool user_be; -#endif - u32 busyloop_timeout; -}; - -struct vhost_msg_node { - struct vhost_msg msg; - struct vhost_virtqueue *vq; - struct list_head node; -}; - -struct vhost_dev { - struct mm_struct *mm; - struct mutex...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...umem; - struct vhost_umem *iotlb; - void *private_data; - u64 acked_features; - /* Log write descriptors */ - void __user *log_base; - struct vhost_log *log; - - /* Ring endianness. Defaults to legacy native endianness. - * Set to true when starting a modern virtio device. */ - bool is_le; -#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY - /* Ring endianness requested by userspace for cross-endian support. */ - bool user_be; -#endif - u32 busyloop_timeout; -}; - -struct vhost_msg_node { - struct vhost_msg msg; - struct vhost_virtqueue *vq; - struct list_head node; -}; - -struct vhost_dev { - struct mm_struct *mm; - struct mutex...
2015 Oct 27
4
[PATCH] vhost: fix performance on LE hosts
.../drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..d3f7674 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -183,10 +183,17 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) { return vq->is_le; } +#else +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + return virtio_legacy_is_little_endian() || vq->is_le; +} +#endif /* Memory accessors */ static inline u16 vho...
2015 Oct 27
4
[PATCH] vhost: fix performance on LE hosts
.../drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..d3f7674 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -183,10 +183,17 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +#ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) { return vq->is_le; } +#else +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + return virtio_legacy_is_little_endian() || vq->is_le; +} +#endif /* Memory accessors */ static inline u16 vho...
2016 Feb 10
0
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...st.c > > index ad2146a9ab2d..e02e06755ab7 100644 > > --- a/drivers/vhost/vhost.c > > +++ b/drivers/vhost/vhost.c > > @@ -43,11 +43,16 @@ enum { > > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > > { > > vq->user_be = !virtio_legacy_is_little_endian(); > > } > > > > Hmm this doesn't look like an imp...
2016 Feb 16
5
[PATCH v2 0/3] vhost: cross-endian code cleanup
This series is a new tentative to have cleaner cross-endian code. Patches 1/3 is new: it fixes a side-effect in case vhost_init_used() fails. Patch 2/3 comes from v1: it renames cross-endian helpers Patch 3/3 is new: it simply renames vhost_init_used() as suggested by Michael. --- Greg Kurz (3): vhost: fix error path in vhost_init_used() vhost: rename cross-endian helpers
2016 Feb 16
5
[PATCH v2 0/3] vhost: cross-endian code cleanup
This series is a new tentative to have cleaner cross-endian code. Patches 1/3 is new: it fixes a side-effect in case vhost_init_used() fails. Patch 2/3 comes from v1: it renames cross-endian helpers Patch 3/3 is new: it simply renames vhost_init_used() as suggested by Michael. --- Greg Kurz (3): vhost: fix error path in vhost_init_used() vhost: rename cross-endian helpers