From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgFZd-0006TQ-JU for qemu-devel@nongnu.org; Tue, 21 Feb 2017 13:54:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgFZa-00069a-It for qemu-devel@nongnu.org; Tue, 21 Feb 2017 13:54:05 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgFZa-00069N-By for qemu-devel@nongnu.org; Tue, 21 Feb 2017 13:54:02 -0500 Received: by mail-wm0-x243.google.com with SMTP id r18so21314634wmd.3 for ; Tue, 21 Feb 2017 10:54:02 -0800 (PST) Sender: Paolo Bonzini References: <1487659615-15820-1-git-send-email-xyjxie@linux.vnet.ibm.com> <20170221092137.5b6cecbb@t450s.home> <27972408-a43b-60f9-86ad-e4e47f4f8f14@redhat.com> From: Paolo Bonzini Message-ID: <1c59cdd0-8cf5-9e66-6457-d01852a5ec37@redhat.com> Date: Tue, 21 Feb 2017 19:53:56 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] memory: make ram device read/write endian sensitive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Alexey Kardashevskiy , Alex Williamson , Yongji Xie , QEMU Developers , zhong@linux.vnet.ibm.com 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. So perhaps we need to add DEVICE_HOST_ENDIAN instead? Paolo