qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] KVM and variable-endianness guest CPUs
@ 2014-01-17 17:53 Peter Maydell
  2014-01-17 18:52 ` Peter Maydell
  0 siblings, 1 reply; 51+ messages in thread
From: Peter Maydell @ 2014-01-17 17:53 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Thomas Falcon, kvm-devel, QEMU Developers, qemu-ppc@nongnu.org,
	kvmarm@lists.cs.columbia.edu, Christoffer Dall

[This seemed like a good jumping off point for this question.]

On 16 January 2014 17:51, Alexander Graf <agraf@suse.de> wrote:
> Am 16.01.2014 um 18:41 schrieb Peter Maydell <peter.maydell@linaro.org>:
>> Also see my remarks on the previous patch series suggesting
>> that we should look at this in a more holistic way than
>> just randomly fixing small bits of things. A good place
>> to start would be "what should the semantics of stl_p()
>> be for a QEMU where the CPU is currently operating with
>> a reversed endianness to the TARGET_WORDS_BIGENDIAN
>> setting?".
>
> That'd open a giant can of worms that I'd rather not open.

Yeah, but you kind of have to open that can, because stl_p()
is used in the code path for KVM MMIO accesses to devices.

Specifically, the KVM API says "here's a uint8_t[] byte
array and a length", and the current QEMU code treats that
as "this is a byte array written as if the guest CPU
(a) were in TARGET_WORDS_BIGENDIAN order and (b) wrote its
I/O access to this buffer rather than to the device".

The KVM API docs don't actually specify the endianness
semantics of the byte array, but I think that that really
needs to be nailed down. I can think of a couple of options:
 * always LE
 * always BE
   [these first two are non-starters because they would
   break either x86 or PPC existing code]
 * always the endianness the guest is at the time
 * always some arbitrary endianness based purely on the
   endianness the KVM implementation used historically
 * always the endianness of the host QEMU binary
 * something else?

Any preferences? Current QEMU code basically assumes
"always the endianness of TARGET_WORDS_BIGENDIAN",
which is pretty random.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2014-01-28 16:31 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-01-28  9:16                 ` Avi Kivity
2014-01-28  9:04           ` [Qemu-devel] " Avi Kivity

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).