From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC16c-0003gv-CO for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:46:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC16Z-0005rA-3n for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:46:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC16Y-0005qt-NG for qemu-devel@nongnu.org; Mon, 06 Jul 2015 03:46:18 -0400 References: <1435842022-13980-1-git-send-email-mst@redhat.com> <5595876E.2040803@redhat.com> <20150702205556-mutt-send-email-mst@redhat.com> <55958AE2.1020600@redhat.com> <20150704230256-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <559A3246.7020103@redhat.com> Date: Mon, 6 Jul 2015 09:46:14 +0200 MIME-Version: 1.0 In-Reply-To: <20150704230256-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-pci: implement cfg capability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org On 04/07/2015 23:19, Michael S. Tsirkin wrote: > The fact that address_space_write/_read actually does a byteswap if > host!=target endian should probably be documented. FWIW, it's not if host != target endian. It's if memory region endianness != target endianness. See memory_region_wrong_endianness. > Or maybe it should be changed: it seems likely that non-target-specific devices > that use it do this incorrectly ATM. In particular, dma_memory_rw_relaxed calls > address_space_rw and since DMA originates with devices I think there's very > little chance that these actually want a different behaviour depending on the > target endian-ness. > > Most likely, these only work correctly because DMA outside RAM > is highly unusual. They work correctly because of that, and because most devices *and* targets are little endian so you have no swap. On ppc64, which has TARGET_WORDS_BIGENDIAN, it probably wouldn't work correctly. Paolo