Received: from eggs.gnu.org ([2001:4830:134:3::10]:48863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6iKj-0003Cc-H9 for qemu-devel@nongnu.org; Mon, 14 Jul 2014 11:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6iKd-0003q1-Fd for qemu-devel@nongnu.org; Mon, 14 Jul 2014 11:38:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44539 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6iKd-0003pq-9u for qemu-devel@nongnu.org; Mon, 14 Jul 2014 11:38:23 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 14 Jul 2014 17:38:18 +0200 Message-Id: <1405352298-21621-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH buildfix for-2.1] libqos: Fix PC PCI endianness glitches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , Gerd Hoffmann The libqos implementation of io_read{b,w,l} and io_write{b,w,l} hooks was relying on qtest_mem{read,write}() respectively. With d81d410 (usb: improve ehci/uhci test) this resulted in assertion failures on ppc hosts: ERROR:tests/usb-hcd-ehci-test.c:78:ehci_port_test: assertion failed: ((v= alue & mask) =3D=3D (expect & mask)) ERROR:tests/usb-hcd-ehci-test.c:128:pci_uhci_port_2: assertion failed: (= pcibus !=3D NULL) ERROR:tests/usb-hcd-ehci-test.c:150:pci_ehci_port_2: assertion failed: (= pcibus !=3D NULL) qtest_read{b,w,l,q}() and qtest_write{b,w,l,q}() had been introduced as endian-safe replacement for qtest_mem{read,write}() in I2C in 872536b (qtest: Add MMIO support). Use them for PCI as well. Cc: Anthony Liguori Cc: Gerd Hoffmann Fixes: c4efe1c qtest: add libqos including PCI support Fixes: d81d410 usb: improve ehci/uhci test Signed-off-by: Andreas F=C3=A4rber --- tests/libqos/pci-pc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index bf741a4..4adf400 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -41,7 +41,7 @@ static uint8_t qpci_pc_io_readb(QPCIBus *bus, void *add= r) if (port < 0x10000) { value =3D inb(port); } else { - memread(port, &value, sizeof(value)); + value =3D readb(port); } =20 return value; @@ -55,7 +55,7 @@ static uint16_t qpci_pc_io_readw(QPCIBus *bus, void *ad= dr) if (port < 0x10000) { value =3D inw(port); } else { - memread(port, &value, sizeof(value)); + value =3D readw(port); } =20 return value; @@ -69,7 +69,7 @@ static uint32_t qpci_pc_io_readl(QPCIBus *bus, void *ad= dr) if (port < 0x10000) { value =3D inl(port); } else { - memread(port, &value, sizeof(value)); + value =3D readl(port); } =20 return value; @@ -82,7 +82,7 @@ static void qpci_pc_io_writeb(QPCIBus *bus, void *addr,= uint8_t value) if (port < 0x10000) { outb(port, value); } else { - memwrite(port, &value, sizeof(value)); + writeb(port, value); } } =20 @@ -93,7 +93,7 @@ static void qpci_pc_io_writew(QPCIBus *bus, void *addr,= uint16_t value) if (port < 0x10000) { outw(port, value); } else { - memwrite(port, &value, sizeof(value)); + writew(port, value); } } =20 @@ -104,7 +104,7 @@ static void qpci_pc_io_writel(QPCIBus *bus, void *add= r, uint32_t value) if (port < 0x10000) { outl(port, value); } else { - memwrite(port, &value, sizeof(value)); + writel(port, value); } } =20 --=20 1.8.4.5