Re: [Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-28 Thread Yongji Xie
on 2017/3/1 8:35, David Gibson wrote: On Tue, Feb 28, 2017 at 06:12:56PM +0800, Yongji Xie wrote: on 2017/2/28 8:41, David Gibson wrote: On Mon, Feb 27, 2017 at 12:52:44PM +0800, Yongji Xie wrote: At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's incorrect. This memory

Re: [Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-28 Thread David Gibson
On Tue, Feb 28, 2017 at 06:12:56PM +0800, Yongji Xie wrote: > on 2017/2/28 8:41, David Gibson wrote: > > > On Mon, Feb 27, 2017 at 12:52:44PM +0800, Yongji Xie wrote: > > > At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's > > > incorrect. This memory region is backed by a M

Re: [Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-28 Thread Yongji Xie
on 2017/2/28 8:41, David Gibson wrote: On Mon, Feb 27, 2017 at 12:52:44PM +0800, Yongji Xie wrote: 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 t

Re: [Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-27 Thread Alexey Kardashevskiy
On 28/02/17 11:41, David Gibson wrote: > On Mon, Feb 27, 2017 at 12:52:44PM +0800, Yongji Xie wrote: >> 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/

Re: [Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-27 Thread David Gibson
On Mon, Feb 27, 2017 at 12:52:44PM +0800, Yongji Xie wrote: > 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 r

[Qemu-devel] [PATCH v2] memory: Introduce DEVICE_HOST_ENDIAN for ram device

2017-02-26 Thread Yongji Xie
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 tar