search for: vhost_has_featur

Displaying 20 results from an estimated 395 matches for "vhost_has_featur".

Did you mean: vhost_has_feature
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...+118,6 @@ struct vhost_dev { struct vhost_memory __rcu *memory; struct mm_struct *mm; struct mutex mutex; - unsigned acked_features; struct vhost_virtqueue **vqs; int nvqs; struct file *log_file; @@ -174,13 +174,8 @@ enum { (1ULL << VHOST_F_LOG_ALL), }; -static inline int vhost_has_feature(struct vhost_dev *dev, int bit) +static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - unsigned acked_features; - - /* TODO: check that we are running from vhost_worker or dev mutex is - * held? */ - acked_features = rcu_dereference_index_check(dev->acked_features, 1);...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...+118,6 @@ struct vhost_dev { struct vhost_memory __rcu *memory; struct mm_struct *mm; struct mutex mutex; - unsigned acked_features; struct vhost_virtqueue **vqs; int nvqs; struct file *log_file; @@ -174,13 +174,8 @@ enum { (1ULL << VHOST_F_LOG_ALL), }; -static inline int vhost_has_feature(struct vhost_dev *dev, int bit) +static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - unsigned acked_features; - - /* TODO: check that we are running from vhost_worker or dev mutex is - * held? */ - acked_features = rcu_dereference_index_check(dev->acked_features, 1);...
2014 Nov 27
1
[PATCH v6 29/46] vhost: add memory access wrappers
...t redhat.com> --- drivers/vhost/vhost.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index c624b09..1f321fd 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -176,4 +176,35 @@ static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { return vq->acked_features & (1ULL << bit); } + +/* Memory accessors */ +static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) +{ + return __virtio16_to_cpu(vhost_has_feature(vq, VIRTIO_F_VERSION_1), val); +} + +static i...
2014 Nov 27
1
[PATCH v6 29/46] vhost: add memory access wrappers
...t redhat.com> --- drivers/vhost/vhost.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index c624b09..1f321fd 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -176,4 +176,35 @@ static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { return vq->acked_features & (1ULL << bit); } + +/* Memory accessors */ +static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) +{ + return __virtio16_to_cpu(vhost_has_feature(vq, VIRTIO_F_VERSION_1), val); +} + +static i...
2018 Oct 12
2
[PATCH net-next V2 6/8] vhost: packed ring support
...t 11:28:09AM +0800, Jason Wang wrote: [...] > @@ -1367,10 +1397,48 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg > vq->last_avail_idx = s.num; > /* Forget the cached index value. */ > vq->avail_idx = vq->last_avail_idx; > + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { > + vq->last_avail_wrap_counter = wrap_counter; > + vq->avail_wrap_counter = vq->last_avail_wrap_counter; > + } > break; > case VHOST_GET_VRING_BASE: > s.index = idx; > s.num = vq->last_avail_idx; > + if (vhost_has_f...
2018 Oct 12
2
[PATCH net-next V2 6/8] vhost: packed ring support
...t 11:28:09AM +0800, Jason Wang wrote: [...] > @@ -1367,10 +1397,48 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg > vq->last_avail_idx = s.num; > /* Forget the cached index value. */ > vq->avail_idx = vq->last_avail_idx; > + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { > + vq->last_avail_wrap_counter = wrap_counter; > + vq->avail_wrap_counter = vq->last_avail_wrap_counter; > + } > break; > case VHOST_GET_VRING_BASE: > s.index = idx; > s.num = vq->last_avail_idx; > + if (vhost_has_f...
2018 Oct 15
2
[PATCH net-next V2 6/8] vhost: packed ring support
...>>> @@ -1367,10 +1397,48 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg >>> vq->last_avail_idx = s.num; >>> /* Forget the cached index value. */ >>> vq->avail_idx = vq->last_avail_idx; >>> + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { >>> + vq->last_avail_wrap_counter = wrap_counter; >>> + vq->avail_wrap_counter = vq->last_avail_wrap_counter; >>> + } >>> break; >>> case VHOST_GET_VRING_BASE: >>> s.index = idx; >>&gt...
2018 Oct 15
2
[PATCH net-next V2 6/8] vhost: packed ring support
...>>> @@ -1367,10 +1397,48 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg >>> vq->last_avail_idx = s.num; >>> /* Forget the cached index value. */ >>> vq->avail_idx = vq->last_avail_idx; >>> + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { >>> + vq->last_avail_wrap_counter = wrap_counter; >>> + vq->avail_wrap_counter = vq->last_avail_wrap_counter; >>> + } >>> break; >>> case VHOST_GET_VRING_BASE: >>> s.index = idx; >>&gt...
2014 Jun 05
1
[PATCH v2 1/2] vhost: move acked_features to VQs
...+118,6 @@ struct vhost_dev { struct vhost_memory __rcu *memory; struct mm_struct *mm; struct mutex mutex; - unsigned acked_features; struct vhost_virtqueue **vqs; int nvqs; struct file *log_file; @@ -174,13 +174,8 @@ enum { (1ULL << VHOST_F_LOG_ALL), }; -static inline int vhost_has_feature(struct vhost_dev *dev, int bit) +static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - unsigned acked_features; - - /* TODO: check that we are running from vhost_worker or dev mutex is - * held? */ - acked_features = rcu_dereference_index_check(dev->acked_features, 1);...
2014 Jun 05
1
[PATCH v2 1/2] vhost: move acked_features to VQs
...+118,6 @@ struct vhost_dev { struct vhost_memory __rcu *memory; struct mm_struct *mm; struct mutex mutex; - unsigned acked_features; struct vhost_virtqueue **vqs; int nvqs; struct file *log_file; @@ -174,13 +174,8 @@ enum { (1ULL << VHOST_F_LOG_ALL), }; -static inline int vhost_has_feature(struct vhost_dev *dev, int bit) +static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - unsigned acked_features; - - /* TODO: check that we are running from vhost_worker or dev mutex is - * held? */ - acked_features = rcu_dereference_index_check(dev->acked_features, 1);...
2014 Nov 25
2
[PATCH v4 25/42] vhost: add memory access wrappers
...rs/vhost/vhost.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 3eda654..b9032e8 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -174,6 +174,37 @@ enum { static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - return vq->acked_features & (1 << bit); + return vq->acked_features & (1ULL << bit); +} + +/* Memory accessors */ +static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) +{ + return __virtio16_to_cpu(vhost_ha...
2014 Nov 25
2
[PATCH v4 25/42] vhost: add memory access wrappers
...rs/vhost/vhost.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 3eda654..b9032e8 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -174,6 +174,37 @@ enum { static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - return vq->acked_features & (1 << bit); + return vq->acked_features & (1ULL << bit); +} + +/* Memory accessors */ +static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) +{ + return __virtio16_to_cpu(vhost_ha...
2015 Apr 23
0
[PATCH v5 5/8] vhost: introduce vhost_is_little_endian() helper
...bm.com> --- drivers/vhost/vhost.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..6a49960 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -173,34 +173,39 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + return vhost_has_feature(vq, VIRTIO_F_VERSION_1); +} + /* Memory accessors */ static inline u16 vhost16_to_cpu(struct vh...
2015 Apr 24
0
[PATCH v6 5/8] vhost: introduce vhost_is_little_endian() helper
...bm.com> --- drivers/vhost/vhost.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..6a49960 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -173,34 +173,39 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + return vhost_has_feature(vq, VIRTIO_F_VERSION_1); +} + /* Memory accessors */ static inline u16 vhost16_to_cpu(struct vh...
2015 Feb 20
0
[PATCH 2/3] vhost: add support for legacy virtio
...EMU with a TARGET_IS_BIENDIAN macro. Please give an advice about how to address this in the vhost code. Thanks. diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index ce2c68e..21e7d6a 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -176,34 +176,42 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) + return true; + else + return !vq->legacy_big_endian; +} + /* Memory...
2015 Feb 20
0
[PATCH 2/3] vhost: add support for legacy virtio
...EMU with a TARGET_IS_BIENDIAN macro. Please give an advice about how to address this in the vhost code. Thanks. diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index ce2c68e..21e7d6a 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -176,34 +176,42 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) return vq->acked_features & (1ULL << bit); } +static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) +{ + if (vhost_has_feature(vq, VIRTIO_F_VERSION_1)) + return true; + else + return !vq->legacy_big_endian; +} + /* Memory...
2018 Oct 15
1
[PATCH net-next V2 6/8] vhost: packed ring support
...@@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg >>>>> vq->last_avail_idx = s.num; >>>>> /* Forget the cached index value. */ >>>>> vq->avail_idx = vq->last_avail_idx; >>>>> + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { >>>>> + vq->last_avail_wrap_counter = wrap_counter; >>>>> + vq->avail_wrap_counter = vq->last_avail_wrap_counter; >>>>> + } >>>>> break; >>>>> case VHOST_GET_VRING_BASE: &...
2015 Apr 23
2
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...gt; } > > static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val) > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 6a49960..954c657 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -175,7 +175,7 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) > > static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) > { > - return vhost_has_feature(vq, VIRTIO_F_VERSION_1); > + return vhost_has_feature(vq, VIRTIO_F_VERSION_1) ? true : virtio_legacy_is_little_endian(); > } That...
2015 Apr 23
2
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...gt; } > > static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val) > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 6a49960..954c657 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -175,7 +175,7 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) > > static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) > { > - return vhost_has_feature(vq, VIRTIO_F_VERSION_1); > + return vhost_has_feature(vq, VIRTIO_F_VERSION_1) ? true : virtio_legacy_is_little_endian(); > } That...
2014 Nov 24
0
[PATCH v3 24/41] vhost: add memory access wrappers
...rs/vhost/vhost.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 3eda654..b9032e8 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -174,6 +174,37 @@ enum { static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit) { - return vq->acked_features & (1 << bit); + return vq->acked_features & (1ULL << bit); +} + +/* Memory accessors */ +static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) +{ + return __virtio16_to_cpu(vhost_ha...