[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [virtio-dev] [PATCH v3 1/7] Vhost-vsock device: Fixed endiannes issue.
On Mon, 14 Mar 2016 18:48:46 +0100 Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> wrote: > On 14/03/16 18:36, Greg Kurz wrote: > >> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > >> index 2c5963c..9378f23 100644 > >> --- a/drivers/vhost/vsock.c > >> +++ b/drivers/vhost/vsock.c > >> @@ -481,6 +481,8 @@ static int vhost_vsock_set_features(struct vhost_vsock *vsock, u64 features) > >> vq = &vsock->vqs[i]; > >> mutex_lock(&vq->mutex); > >> vq->acked_features = features; > >> + vq->is_le = virtio_legacy_is_little_endian(); > >> + vhost_init_is_le(vq); > > > > How can you call vhost_init_is_le() from here ? > > I can't, it's an error, sorry! > Also, as I wrote already earlier, I noticed that that call is not needed > because that field is initialized already somewhere else. I already > removed it in my branch and it won't be there in the next version of the > patchset. > > Claudio vq->is_le is initialized to virtio_legacy_is_little_endian() in vhost_vq_reset(): this is the default behavior for vhost devices to use rings with native endianness. Then vq->is_le can be set again from vhost_init_used()->vhost_init_is_le() if the device is virtio 1 or userspace called the VHOST_SET_VRING_ENDIAN ioctl. This obviously won't work for vsock since it does not call vhost_init_used()... I don't know enough on vsock to see how to handle that, but basically we must be able to: 1) negotiate virtio 1 2) optionally ask for cross-endian 3) use the device 1) and 2) can be done in any order but must be done before 3) -- Greg
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]