On Thu, Mar 03, 2011 at 07:50:03PM +0000, Stefan Hajnoczi wrote:
> On Thu, Mar 3, 2011 at 7:16 PM, Aurelien Jarno <aurel...@aurel32.net> wrote:
> > The endianness handling in virtio-net is different than in virtio-blk.
> > In virtio-blk we basically have to byteswap the data when the endianness
> > of the guest is different than the one of the guest. If I am correct, in
> > virtio-net it seems we have to byteswap the data solely depending on the
> > guest endianness and independently on the host endianness. This is
> > something quite weird that we don't have in cpu-all.h
> 
> That sounds odd.  Virtio is guest endian so the host must do
> guest<->host endian conversion.  Which bits of code make you think
> otherwise?
> 

That's exactly what my patch was doing, changing the ldx_le_p() into 
ldx_p(). In pratice it doesn't work.

Basically, with ldlx_le_p(), it only works when the endianness of the
guess and of the host are the same. With ldx_p() it only works when the
host is little endian. That's how I conclude that byteswapping should
only be done on big endian guests.

I agree it's weird and should be validated by some real tests, I am 
planning to do that soon.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurel...@aurel32.net                 http://www.aurel32.net

Reply via email to