libqos: Fix PC PCI endianness glitches
commit0e16297461264b3ea8f7282d1195cf53aa8a707c
authorAndreas Färber <afaerber@suse.de>
Mon, 14 Jul 2014 15:38:18 +0000 (14 17:38 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Jul 2014 13:18:15 +0000 (15 14:18 +0100)
treecadfdca8d6e142a46ccb6a65fa704d48163bb77b
parent0a9934eef166836c8100fce72f7f837cb8b2ed2b
libqos: Fix PC PCI endianness glitches

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: ((value & mask) == (expect & mask))

 ERROR:tests/usb-hcd-ehci-test.c:128:pci_uhci_port_2: assertion failed: (pcibus != NULL)

 ERROR:tests/usb-hcd-ehci-test.c:150:pci_ehci_port_2: assertion failed: (pcibus != 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 <aliguori@amazon.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Fixes: c4efe1c qtest: add libqos including PCI support
Fixes: d81d410 usb: improve ehci/uhci test
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/libqos/pci-pc.c