Re: [PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-23 Thread Stefan Hajnoczi
On Tue, Oct 22, 2019 at 06:51:39PM +0200, Christophe de Dinechin wrote: > > Stefan Hajnoczi writes: > [...] > > +static uint16_t qvirtio_readw(QVirtioDevice *d, QTestState *qts, uint64_t > > addr) > > +{ > > +uint16_t val = qtest_readw(qts, addr); > > + > > +if (d->features & (1ull <<

Re: [PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-22 Thread Christophe de Dinechin
Stefan Hajnoczi writes: [...] > +static uint16_t qvirtio_readw(QVirtioDevice *d, QTestState *qts, uint64_t > addr) > +{ > +uint16_t val = qtest_readw(qts, addr); > + > +if (d->features & (1ull << VIRTIO_F_VERSION_1) && qtest_big_endian(qts)) > { For my education, I was wondering why

Re: [PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-22 Thread Stefan Hajnoczi
On Mon, Oct 21, 2019 at 02:48:08PM +0200, Thomas Huth wrote: > On 19/10/2019 08.38, Stefan Hajnoczi wrote: > > VIRTIO 1.0 uses little-endian for the vring. Legacy VIRTIO uses guest > > endianness. Adjust the code to handle both. > > > > Note that qvirtio_readq() is not defined because it has no

Re: [PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-21 Thread Thomas Huth
On 19/10/2019 08.38, Stefan Hajnoczi wrote: > VIRTIO 1.0 uses little-endian for the vring. Legacy VIRTIO uses guest > endianness. Adjust the code to handle both. > > Note that qvirtio_readq() is not defined because it has no users. All > the other accessors are really needed. > >

[PATCH v3 09/16] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-19 Thread Stefan Hajnoczi
VIRTIO 1.0 uses little-endian for the vring. Legacy VIRTIO uses guest endianness. Adjust the code to handle both. Note that qvirtio_readq() is not defined because it has no users. All the other accessors are really needed. Signed-off-by: Stefan Hajnoczi --- tests/libqos/virtio.h | 4