From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmtcE-0006pj-HS for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:57:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmtcD-0006eh-D9 for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:57:18 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:48449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmtcD-0006ed-97 for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:57:17 -0500 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Jan 2012 15:57:15 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 446EE38CB60F for ; Mon, 16 Jan 2012 12:20:22 -0500 (EST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0GHKLso335408 for ; Mon, 16 Jan 2012 12:20:21 -0500 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0GHKKKt010851 for ; Mon, 16 Jan 2012 10:20:21 -0700 Message-ID: <4F145C50.6040607@us.ibm.com> Date: Mon, 16 Jan 2012 11:20:16 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1326479558-3016-1-git-send-email-aliguori@us.ibm.com> <4F1459A4.2030502@redhat.com> In-Reply-To: <4F1459A4.2030502@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/6] qtest: add test framework List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini On 01/16/2012 11:08 AM, Avi Kivity wrote: > On 01/16/2012 06:59 PM, Stefan Hajnoczi wrote: >>> + } >>> + qtest_send_prefix(chr); >>> + qtest_send(chr, "OK 0x%04x\n", value); >> >> Endianness is a little weird here. memory.c will byteswap if target >> and device endianness differ. >> >> Imagine the case where we're on an x86 host, running a ppc guest, >> reading from PCI configuration space (little-endian). Since ppc >> (target endian) is big-endian and the device is little-endian the >> value read/written will be byteswapped. However, our qtest runs on >> the host and therefore we don't want that automatic swap (or we need >> to neutralize it by performing another byteswap on top). >> > > Good catch. This is another example of how an access depends not only > on the destination, but also on the source. Here the source is not the > cpu; it's qtest. target-ppc never calls cpu_out. It's prep_pci.c that calls it based on an MMIO operation and that's where the endianess conversion happens. You wouldn't use outw() in a qtest harness when talking to a PCI device over PPC. What we really want is to be able to send I/O directly to MemoryRegions but that's a bit different than what qtest is. Regards, Anthony Liguori >