On Fri, Oct 07, 2016 at 12:48:49PM +0200, Greg Kurz wrote: > On Fri, 7 Oct 2016 12:14:27 +0200 > Laurent Vivier <lviv...@redhat.com> wrote: > > > The target endianness is not deduced anymore from > > the architecture name but asked directly to the guest, > > using a new qtest command: "endianness". As it can't > > change (this is the value of TARGET_WORDS_BIGENDIAN), > > we store it to not have to ask every time we want to > > know if we have to byte-swap a value. > > > > Signed-off-by: Laurent Vivier <lviv...@redhat.com> > > CC: Greg Kurz <gr...@kaod.org> > > CC: David Gibson <da...@gibson.dropbear.id.au> > > CC: Peter Maydell <peter.mayd...@linaro.org> > > --- > > v2: > > - move the "endianness" command to a function and > > don't move the qtest_init()/qtest_quit() functions > > > > Not speaking about the current discussion on TARGET_WORDS_BIGENDIAN, > I guess a consensus could be that this only makes sense when testing > legacy virtio. People should not be tempted to use this anywhere else > actually.
I agree in principle. However right now - until we get fixed-endianness qtest accessors of some sort - this test is more or less necessary to make most tests cross platform correct (except PCI, see below). That's because the testcase will generally know the endianness of the hardware it's testing, but has to compensate for the endianness that the readw/writew primitives will use along the way. For PCI we side steo this, because the PCI read/write wrappers are already target specific, and include unconditional swaps to compoensate for the "guest endianness". -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature