OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[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 17:18:24 +0200
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:

> 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.
> 

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: virtio-dev-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]