]> git.proxmox.com Git - mirror_qemu.git/commit
memory: Introduce DEVICE_HOST_ENDIAN for ram device
authorYongji Xie <xyjxie@linux.vnet.ibm.com>
Mon, 27 Feb 2017 04:52:44 +0000 (12:52 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 Mar 2017 15:40:03 +0000 (16:40 +0100)
commitc99a29e702528698c0ce2590f06ca7ff239f7c39
tree5c261dda694a0dcf9410c12305b4a83c6326d6d8
parent11953be792998c43bf2cad4ad3deaeaeaf89dbb4
memory: Introduce DEVICE_HOST_ENDIAN for ram device

At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's
incorrect. This memory region is backed by a MMIO area in host, so the
uint64_t data that MemoryRegionOps read from/write to this area should be
host-endian rather than target-endian. Hence, current code does not work
when target and host endianness are different which is the most common case
on PPC64. To fix it, this introduces DEVICE_HOST_ENDIAN for the ram device.

This has been tested on PPC64 BE/LE host/guest in all possible combinations
including TCG.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
Message-Id: <1488171164-28319-1-git-send-email-xyjxie@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/exec/cpu-common.h
memory.c