[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [virtio-dev] [PATCH v4 1/6] virtio-vsock vhost device: fixed endiannes issue
On Fri, 1 Apr 2016 16:32:10 +0200 Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> wrote: > > and even if you make vhost_init_is_le() extern, this won't work if the device > > is in legacy mode, and the host and guest have different endianness. > > > > This is because vhost_init_is_le() computes vq->is_le as follows when we > > have CONFIG_VHOST_CROSS_ENDIAN_LEGACY=y: > > > > vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1) || !vq->user_be; > > > > and vq->user_be comes from the VHOST_SET_VRING_ENDIAN ioctl. > > I was wondering if we can just put vq->is_le = 1 instead of > vhost_init_is_le(), and call it a day. virtio-vsock is a virtio 1.0 > device, so we are always little endian anyway. > Sure, with a comment maybe to explain why it is different from the other vhost drivers. Something like: /* virtio-vsock is a virtio 1.0 only device: we can enforce little-endian * here, instead of calling vhost_init_is_le() since we don't care for * the transitional case. */ And of course, you can simply ignore all my previous remarks on the cross-endian stuff which belongs to the transitional case. > cheers > > > Claudio > > Cheers. -- Greg
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]