Next in thread → Next in month →

Re: [virtio-dev] [PATCH v4 1/6] virtio-vsock vhost device: fixed endiannes issue

From
Greg Kurz <>
Date
2016-04-01T16:11:42+00:00
ID
Thread
Re: [virtio-dev] [PATCH v4 1/6] virtio-vsock vhost device: fixed endiannes issue
On Fri, 1 Apr 2016 17:18:24 +0200
Greg Kurz <> wrote:

> On Fri, 1 Apr 2016 16:32:10 +0200
> Claudio Imbrenda <> 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.
> 

And you can ignore all that: Stefan has reworked the patches in his tree.
The vsock driver now calls vhost_vq_init_access() which internally calls
vhost_init_is_le().

Cheers.

--
Greg

> > cheers
> > 
> > 
> > Claudio
> > 
> >   
> 
> Cheers.
> 
> --
> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
Next in thread → Next in month →