On 21 February 2017 at 18:53, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 21/02/2017 19:09, Peter Maydell wrote: >> In this instance I don't understand the patch. The ram_device >> mem-ops are there to deal with memory regions backed by a >> lump of RAM, right? Lumps of memory are always the endianness >> of the host CPU by definition, so DEVICE_NATIVE_ENDIAN and >> no swapping in the accessors seems like it ought to be the right >> thing... > > DEVICE_NATIVE_ENDIAN is the endianness of the target CPU however.
...I meant 'target CPU' there (at any rate, endianness of the bus interface between target CPU and its RAM; CPUs like ARM with runtime configurable endianness do it by swapping data before it hits the bus interface, conceptually speaking). Endianness always confuses me, though (I think I understand it and then I realize I don't; I also have trouble telling whether I understand it and am discussing it with somebody who doesn't understand it, or whether I don't understand it and they do...) thanks -- PMM