qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/6] qtest: add test framework


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/6] qtest: add test framework
Date: Mon, 16 Jan 2012 11:20:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]