From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>, qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, Peter Maydell <peter.maydell@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH buildfix for-2.1] libqos: Fix PC PCI endianness glitches
Date: Mon, 14 Jul 2014 17:47:35 +0200 [thread overview]
Message-ID: <53C3FB97.1040004@redhat.com> (raw)
In-Reply-To: <1405352298-21621-1-git-send-email-afaerber@suse.de>
Il 14/07/2014 17:38, Andreas Färber ha scritto:
> 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>
> ---
> 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 *addr)
> if (port < 0x10000) {
> value = inb(port);
> } else {
> - memread(port, &value, sizeof(value));
> + value = readb(port);
> }
>
> return value;
> @@ -55,7 +55,7 @@ static uint16_t qpci_pc_io_readw(QPCIBus *bus, void *addr)
> if (port < 0x10000) {
> value = inw(port);
> } else {
> - memread(port, &value, sizeof(value));
> + value = readw(port);
> }
>
> return value;
> @@ -69,7 +69,7 @@ static uint32_t qpci_pc_io_readl(QPCIBus *bus, void *addr)
> if (port < 0x10000) {
> value = inl(port);
> } else {
> - memread(port, &value, sizeof(value));
> + value = readl(port);
> }
>
> 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);
> }
> }
>
> @@ -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);
> }
> }
>
> @@ -104,7 +104,7 @@ static void qpci_pc_io_writel(QPCIBus *bus, void *addr, uint32_t value)
> if (port < 0x10000) {
> outl(port, value);
> } else {
> - memwrite(port, &value, sizeof(value));
> + writel(port, value);
> }
> }
>
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2014-07-14 15:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 15:38 [Qemu-devel] [PATCH buildfix for-2.1] libqos: Fix PC PCI endianness glitches Andreas Färber
2014-07-14 15:47 ` Paolo Bonzini [this message]
2014-07-15 14:05 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C3FB97.1040004@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=aik@ozlabs.ru \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.