From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsArw-0005Sc-Qa for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:46:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsArr-0003bJ-S7 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:45:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsArr-0003b9-Kq for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:45:55 -0400 References: <1475583448-21013-1-git-send-email-clg@kaod.org> <20161004234352.GE18648@umbus.fritz.box> <20161006033836.GC18733@umbus.fritz.box> <20161006161142.1d56f98c@bahia> From: Paolo Bonzini Message-ID: Date: Thu, 6 Oct 2016 17:45:51 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , Greg Kurz , Peter Maydell Cc: QEMU Developers , Laurent Vivier , David Gibson On 06/10/2016 17:44, C=E9dric Le Goater wrote: > On 10/06/2016 05:36 PM, Paolo Bonzini wrote: >> >> >> On 06/10/2016 16:11, Greg Kurz wrote: >>> FWIW, Cedric had another proposal which apparently went unnoticed: >>> >>> >>> >>> The idea is to add an optional endianness argument to the read*/write= * >>> commands in the qtest protocol: >>> - libqtest then provides explicit _le and _be APIs >>> - no extra byteswap is performed on the test program side: qtest >>> actually handles that and does exactly 1 or 0 byteswap. >>> - it does not use memread/memwrite >>> - the current 'guest native' API where qtest tswaps is preserved >>> >> >> No, this is a worse idea, because the right place to do the swap is in >> the "program" (libqtest) not in the "CPU" (QEMU). >=20 > So the current patch, minus the typos, seems to be a "better" solution. Yes, at least I don't think it's a problem that it uses "memread" and "memwrite". It's just address_space_rw under the hood, and we know that it does the right thing with MMIO addresses. Paolo