qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
	kvm-devel <kvm@vger.kernel.org>,
	Victor Kamensky <victor.kamensky@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] KVM and variable-endianness guest CPUs
Date: Tue, 28 Jan 2014 10:27:09 +1100	[thread overview]
Message-ID: <1390865229.3872.27.camel@pasglop> (raw)
In-Reply-To: <CAFEAcA_-dejumAVf6RBD8A47SG2pQFcFVJ91OxcYdasa+CYb0Q@mail.gmail.com>

On Wed, 2014-01-22 at 17:29 +0000, Peter Maydell wrote:
> 
> > Basically if it would be on real bus, get byte value
> > that corresponds to phys_addr + 0 address place
> > it into data[0], get byte value that corresponds to
> > phys_addr + 1 address place it into data[1], etc.
> 
> This just isn't how real buses work.

Actually it can be :-)

>  There is no
> "address + 1, address + 2". There is a single address
> for the memory transaction and a set of data on
> data lines and some separate size information.
> How the device at the far end of the bus chooses
> to respond to 32 bit accesses to address X versus
> 8 bit accesses to addresses X through X+3 is entirely
> its own business and unrelated to the CPU.

However the bus has a definition of what byte lane is the lowest in
address order. Byte order invariance is an important function of
all busses.

I think that trying to treat it any differently than an address
ordered series of bytes is going to turn into a complete and
inextricable mess.

>  (It would
> be perfectly possible to have a device which when
> you read from address X as 32 bits returned 0x12345678,
> when you read from address X as 16 bits returned
> 0x9abc, returned 0x42 for an 8 bit read from X+1,
> and so on. Having byte reads from X..X+3 return
> values corresponding to parts of the 32 bit access
> is purely a convention.)

Right, it's possible. It's also stupid and not how most modern devices
and busses work. Besides there is no reason why that can't be
implemented with Victor proposal anyway.

Ben.

  parent reply	other threads:[~2014-01-27 23:27 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 17:53 [Qemu-devel] KVM and variable-endianness guest CPUs Peter Maydell
2014-01-17 18:52 ` Peter Maydell
2014-01-18  4:24   ` Christoffer Dall
2014-01-18  7:32     ` Alexander Graf
2014-01-18 10:15       ` Peter Maydell
2014-01-20 14:20         ` Alexander Graf
2014-01-20 14:31           ` Peter Maydell
2014-01-20 14:22   ` Alexander Graf
2014-01-20 19:19     ` Christoffer Dall
2014-01-22  5:39       ` Victor Kamensky
2014-01-22  6:31         ` Anup Patel
2014-01-22  6:41           ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-01-22  7:26             ` Victor Kamensky
2014-01-22 10:52               ` Alexander Graf
2014-01-23  4:25                 ` Victor Kamensky
2014-01-23 10:32                   ` Alexander Graf
2014-01-23 10:56                   ` Greg Kurz
2014-01-22  8:57             ` Anup Patel
2014-01-23 23:28               ` Christoffer Dall
2014-01-22 10:22         ` [Qemu-devel] " Peter Maydell
2014-01-22 17:19           ` Victor Kamensky
2014-01-22 17:29             ` Peter Maydell
2014-01-22 19:29               ` Victor Kamensky
2014-01-22 20:02                 ` Peter Maydell
2014-01-22 22:47                   ` Victor Kamensky
2014-01-22 23:18                     ` Peter Maydell
2014-01-23  0:22                       ` Victor Kamensky
2014-01-23 10:23                         ` Peter Maydell
2014-01-23 15:06                           ` Victor Kamensky
2014-01-23 15:33                             ` Peter Maydell
2014-01-23 16:25                               ` Victor Kamensky
2014-01-23 20:45                                 ` Christoffer Dall
2014-01-24  0:50                                   ` Victor Kamensky
2014-01-24  2:14                                     ` Christoffer Dall
2014-01-24  4:11                                       ` Victor Kamensky
2014-01-28  0:32                                         ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2014-01-28  0:40                                           ` Christoffer Dall
2014-01-28  0:15                                   ` Benjamin Herrenschmidt
2014-01-24  0:09                                 ` [Qemu-devel] " Victor Kamensky
2014-01-28  0:07                               ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2014-01-28  0:07                                 ` Benjamin Herrenschmidt
2014-01-27 23:34                   ` Benjamin Herrenschmidt
2014-01-27 23:49                     ` Peter Maydell
2014-01-28  0:36                       ` Benjamin Herrenschmidt
2014-01-28  0:44                         ` Christoffer Dall
2014-01-28  4:47                           ` Benjamin Herrenschmidt
2014-01-28 16:31                             ` Christoffer Dall
2014-01-27 23:31                 ` Benjamin Herrenschmidt
2014-01-27 23:27               ` Benjamin Herrenschmidt [this message]
2014-01-28  9:16                 ` Avi Kivity
2014-01-28  9:04           ` [Qemu-devel] " Avi Kivity

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=1390865229.3872.27.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tlfalcon@linux.vnet.ibm.com \
    --cc=victor.kamensky@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).