Received: from eggs.gnu.org ([2001:4830:134:3::10]:54954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brTJW-00023c-W7 for qemu-devel@nongnu.org; Tue, 04 Oct 2016 13:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brTJS-0004Y0-II for qemu-devel@nongnu.org; Tue, 04 Oct 2016 13:15:33 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brTJS-0004Xn-5t for qemu-devel@nongnu.org; Tue, 04 Oct 2016 13:15:30 -0400 Received: by mail-wm0-x242.google.com with SMTP id f193so16057593wmg.2 for ; Tue, 04 Oct 2016 10:15:30 -0700 (PDT) Sender: Paolo Bonzini References: <1475583448-21013-1-git-send-email-clg@kaod.org> From: Paolo Bonzini Message-ID: <2b769e0b-692e-2743-60ac-69718325aa44@redhat.com> Date: Tue, 4 Oct 2016 19:15:21 +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 , =?UTF-8?Q?C=c3=a9dric_Le_Goate?= =?UTF-8?Q?r?= Cc: Laurent Vivier , Greg Kurz , QEMU Developers , David Gibson On 04/10/2016 14:36, Peter Maydell wrote: > > - first, convert the value to the required endianness in libqtest and > > then use the memread/write routines so that qtest accesses the guest > > memory without doing any supplementary byteswapping > > > > - an alternative method would be to handle the byte swapping on the > > qtest side. For that, we would need to extend the read/write > > protocol with an ending word : "native|le|be" and modify the tswap > > calls accordingly under the qtest_process_command() routine. > > > > The result is the same and the first method is simpler. > > The difficulty with this patch is that it's hard to tell whether > it's really required, or if this is just adding an extra layer > of byteswapping that should really be done in some other location > in the stack. What's the actual test case here? I think the first method makes sense. The second would be the wrong side. Paolo