Received: from eggs.gnu.org ([2001:4830:134:3::10]:47360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsB4g-00089A-4Q for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsB4a-0001G5-SG for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:59:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsB4a-0001Eh-Lm for qemu-devel@nongnu.org; Thu, 06 Oct 2016 11:59:04 -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: Laurent Vivier Message-ID: Date: Thu, 6 Oct 2016 17:59:00 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Peter Maydell , Paolo Bonzini Cc: Greg Kurz , QEMU Developers , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , David Gibson On 06/10/2016 17:41, Peter Maydell wrote: > On 6 October 2016 at 16:36, 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). > > Speaking of the right place to do things, perhaps we should > reimplement qtest_big_endian() in libqtest.c to send a query > to the QEMU-under-test to ask it what TARGET_BIG_ENDIAN says, > rather than hardcoding a big list of architectures... Yes, it's a good idea. I can do that... Laurent