All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Greg Kurz" <gkurz@linux.vnet.ibm.com>,
	"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness
Date: Fri, 7 Oct 2016 10:09:05 +1100	[thread overview]
Message-ID: <20161006230905.GA18490@umbus.fritz.box> (raw)
In-Reply-To: <CAFEAcA99awhZWfs3LNwZpuFgbDyS+6QdjK7NaHN1J8joaZwhnA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2301 bytes --]

On Thu, Oct 06, 2016 at 11:47:36AM +0100, Peter Maydell wrote:
> On 6 October 2016 at 04:45, David Gibson <david@gibson.dropbear.id.au> wrote:
> > On Wed, Oct 05, 2016 at 07:20:52AM -0700, Peter Maydell wrote:
> >> On 5 October 2016 at 07:00, Cédric Le Goater <clg@kaod.org> wrote:
> >> > On 10/05/2016 03:53 PM, Peter Maydell wrote:
> >> >> Which tswap? Last time I worked through the stack of
> >> >> what happens I thought that we had the right set of
> >> >> swaps in the right places.
> >> >
> >> > The one I am talking about are under qtest_process_command(),
> >> > see below.
> >>
> >> Those are correct and required, and they do not change
> >> the overall behaviour of the system depending on the host
> >> endianness. (They convert 32-bit values to "bag of
> >> bytes in guest order" which is what the cpu_physical_memory_*
> >> functions want.)
> >
> > These functions are correct for the defined semantics of the
> > readw/readl operations, but those semantics are not useful.
> 
> ?? They're the most obvious and required semantics: "act
> like the CPU just did a word/halfword/byte read/write".

The CPU with what mode and options?

> There's a reason we've got this far without needing anything
> else, and it's that this is the most straightforward use case.

No, I'm pretty sure we've got this far because most of the tests
haven't yet been enabled for a traditionally BE target.

> > This proposal is introducing alternate functions with the more useful
> > semantics which are "convert a 32-bit value to a bag of bytes in LE
> > order" or "convert a 32-bit value to a bag of bytes in BE order"
> > depending on which variant you choose.
> 
> It's adding functions whose semantics are "act like the
> CPU wrote this value to some RAM and then memcpy()ed it to
> the device". I think devices whose usage model is "memcpy bytes
> to me" are rare to nonexistent.

Uh, that's not the intention.  I have some comments on this elsewhere.

The intended semantics are that we do a single atomic write to an
address, but with a specific 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-10-07  0:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 12:17 [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness Cédric Le Goater
2016-10-04 12:36 ` Peter Maydell
2016-10-04 14:04   ` Laurent Vivier
2016-10-04 14:07   ` Cédric Le Goater
2016-10-04 17:15   ` Paolo Bonzini
2016-10-04 23:43   ` David Gibson
2016-10-05  5:59     ` Cédric Le Goater
2016-10-05 12:31     ` Peter Maydell
2016-10-05 13:49       ` Cédric Le Goater
2016-10-05 13:53         ` Peter Maydell
2016-10-05 14:00           ` Cédric Le Goater
2016-10-05 14:20             ` Peter Maydell
2016-10-05 17:17               ` Cédric Le Goater
2016-10-05 17:32                 ` Peter Maydell
2016-10-06  3:45               ` David Gibson
2016-10-06  7:23                 ` Paolo Bonzini
2016-10-06  8:37                   ` David Gibson
2016-10-06  9:40                     ` Paolo Bonzini
2016-10-06 10:44                       ` Cédric Le Goater
2016-10-06 10:47                 ` Peter Maydell
2016-10-06 23:09                   ` David Gibson [this message]
2016-10-06  3:40         ` David Gibson
2016-10-06  3:38       ` David Gibson
2016-10-06  6:10         ` David Gibson
2016-10-06 11:03         ` Peter Maydell
2016-10-06 14:11           ` Greg Kurz
2016-10-06 15:36             ` Paolo Bonzini
2016-10-06 15:41               ` Peter Maydell
2016-10-06 15:59                 ` Laurent Vivier
2016-10-06 23:34                   ` David Gibson
2016-10-07  7:44                     ` Laurent Vivier
2016-10-06 15:44               ` Cédric Le Goater
2016-10-06 15:45                 ` Paolo Bonzini
2016-10-06 23:43               ` David Gibson
2016-10-06 23:31             ` David Gibson
2016-10-06 23:31           ` David Gibson
2016-10-07  9:52             ` Peter Maydell
2016-10-04 23:26 ` David Gibson
2016-10-05  5:36   ` Cédric Le Goater

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=20161006230905.GA18490@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=gkurz@linux.vnet.ibm.com \
    --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.