qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()
Date: Mon, 10 Oct 2016 15:55:52 +1100
User-agent: Mutt/1.7.0 (2016-08-17)

On Fri, Oct 07, 2016 at 12:48:49PM +0200, Greg Kurz wrote:
> On Fri,  7 Oct 2016 12:14:27 +0200
> Laurent Vivier <address@hidden> 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 <address@hidden>
> > CC: Greg Kurz <address@hidden>
> > CC: David Gibson <address@hidden>
> > CC: Peter Maydell <address@hidden>
> > ---
> > 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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]