From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Greg Kurz <groug@kaod.org>, Laurent Vivier <lvivier@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()
Date: Tue, 11 Oct 2016 14:56:23 +1100 [thread overview]
Message-ID: <20161011035623.GD8952@umbus.fritz.box> (raw)
In-Reply-To: <20161011012429.GA8952@umbus.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]
On Tue, Oct 11, 2016 at 12:24:29PM +1100, David Gibson wrote:
> On Mon, Oct 10, 2016 at 03:10:33PM +0100, Peter Maydell wrote:
> > On 10 October 2016 at 14:39, David Gibson <david@gibson.dropbear.id.au> wrote:
> > > In the overwhelming majority of cases the endianness of the device is
> > > known independent of the guest CPU and board.
> >
> > We don't seem to model things that way:
> >
> > $ git grep '.endianness = DEVICE_NATIVE' |wc -l
> > 341
> > $ git grep '.endianness = DEVICE_BIG' |wc -l
> > 18
> > $ git grep '.endianness = DEVICE_LITTLE' |wc -l
> > 172
>
> Sigh. So, most of these are themselves mistakes.
>
> A lot of these are target specific devices that should be tagged with
> their target's (notional) endianness, rather than NATIVE. That
> covers:
A couple of points of clarification here.
When I say the "device" endianness is known, that's a little sloppy.
I mean that the endianness of each specific register (or DMA field)
has a known endianness. The device as a whole does not have well
defined endianness except insofar as one device will generally use the
same endianness for all its >8bit registers and/or DMA fields.
There are a few exceptions of course. virtio-balloon (pre 1.0) on a
notionally BE platform is a horrible example: its PCI config space is
LE, the generic part of the virtio config space is BE ("native") and
the balloon specific part is LE again (due to a screwup in the spec).
Intermediate bridges in the system (on or off chip) won't affect this,
*as long as* they preserve byte address invariance. If they *don't*
preserve byte address invariance, then:
1) Shoot your HW designer
2) Grudgingly work around with special cases in your tests
--
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-10-11 4:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 10:14 [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init() Laurent Vivier
2016-10-07 10:48 ` Greg Kurz
2016-10-07 10:57 ` Laurent Vivier
2016-10-07 12:27 ` Greg Kurz
2016-10-07 12:31 ` Peter Maydell
2016-10-07 12:45 ` Greg Kurz
2016-10-07 12:52 ` Peter Maydell
2016-10-07 12:56 ` Laurent Vivier
2016-10-07 13:08 ` Greg Kurz
2016-10-10 4:55 ` David Gibson
2016-10-10 9:18 ` Peter Maydell
2016-10-10 13:39 ` David Gibson
2016-10-10 14:10 ` Peter Maydell
2016-10-11 1:24 ` David Gibson
2016-10-11 3:56 ` David Gibson [this message]
2016-10-11 8:55 ` Peter Maydell
2016-10-11 9:56 ` David Gibson
2016-10-10 4:52 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161011035623.GD8952@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.