From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpv3z-0003ho-Ay for qemu-devel@nongnu.org; Fri, 30 Sep 2016 06:29:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpv3x-0000E1-M8 for qemu-devel@nongnu.org; Fri, 30 Sep 2016 06:29:07 -0400 Date: Fri, 30 Sep 2016 19:06:34 +1000 From: David Gibson Message-ID: <20160930090634.GB23399@umbus.fritz.box> References: <1475169307-1510-1-git-send-email-lvivier@redhat.com> <1475169307-1510-4-git-send-email-lvivier@redhat.com> <20160930013045.GS30519@umbus.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rQ2U398070+RC21q" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] tests: enable virtio tests on SPAPR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org, dgibson@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org, Greg Kurz --rQ2U398070+RC21q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 30, 2016 at 08:59:39AM +0200, Laurent Vivier wrote: >=20 >=20 > On 30/09/2016 03:30, David Gibson wrote: > > On Thu, Sep 29, 2016 at 07:15:07PM +0200, Laurent Vivier wrote: > >> but disable MSI-X tests on SPAPR as we can't check the result > >> (the memory region used on PC is not readable on SPAPR). > >> > >> Signed-off-by: Laurent Vivier > >> --- > >> tests/Makefile.include | 3 ++- > >> tests/libqos/virtio-pci.c | 22 ++++++++++++++++++++-- > >> tests/virtio-9p-test.c | 11 ++++++++++- > >> tests/virtio-blk-test.c | 22 +++++++++++++++++----- > >> tests/virtio-net-test.c | 17 +++++++++++++++-- > >> tests/virtio-rng-test.c | 7 ++++++- > >> tests/virtio-scsi-test.c | 10 +++++++++- > >> 7 files changed, 79 insertions(+), 13 deletions(-) > >> > >> diff --git a/tests/Makefile.include b/tests/Makefile.include > >> index c46a32d..1e4a3d5 100644 > >> --- a/tests/Makefile.include > >> +++ b/tests/Makefile.include > >> @@ -278,6 +278,7 @@ check-qtest-ppc64-y +=3D tests/usb-hcd-uhci-test$(= EXESUF) > >> gcov-files-ppc64-y +=3D hw/usb/hcd-uhci.c > >> check-qtest-ppc64-y +=3D tests/usb-hcd-xhci-test$(EXESUF) > >> gcov-files-ppc64-y +=3D hw/usb/hcd-xhci.c > >> +check-qtest-ppc64-y +=3D $(check-qtest-virtio-y) > >> =20 > >> check-qtest-sh4-y =3D tests/endianness-test$(EXESUF) > >> =20 > >> @@ -604,7 +605,7 @@ libqos-pc-obj-y +=3D tests/libqos/ahci.o > >> libqos-omap-obj-y =3D $(libqos-obj-y) tests/libqos/i2c-omap.o > >> libqos-imx-obj-y =3D $(libqos-obj-y) tests/libqos/i2c-imx.o > >> libqos-usb-obj-y =3D $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/l= ibqos/usb.o > >> -libqos-virtio-obj-y =3D $(libqos-pc-obj-y) tests/libqos/virtio.o test= s/libqos/virtio-pci.o tests/libqos/virtio-mmio.o tests/libqos/malloc-generi= c.o > >> +libqos-virtio-obj-y =3D $(libqos-spapr-obj-y) $(libqos-pc-obj-y) test= s/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o test= s/libqos/malloc-generic.o > >> =20 > >> tests/device-introspect-test$(EXESUF): tests/device-introspect-test.o > >> tests/rtc-test$(EXESUF): tests/rtc-test.o > >> diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c > >> index 6e005c1..ed81df6 100644 > >> --- a/tests/libqos/virtio-pci.c > >> +++ b/tests/libqos/virtio-pci.c > >> @@ -68,16 +68,34 @@ static uint8_t qvirtio_pci_config_readb(QVirtioDev= ice *d, uint64_t addr) > >> return qpci_io_readb(dev->pdev, (void *)(uintptr_t)addr); > >> } > >> =20 > >> +/* PCI is always read in little-endian order > >> + * but virtio ( < 1.0) is in guest order > >> + * so with a big-endian guest the order has been reversed > >> + * reverse it again > >> + */ > >> + > >> static uint16_t qvirtio_pci_config_readw(QVirtioDevice *d, uint64_t a= ddr) > >> { > >> QVirtioPCIDevice *dev =3D (QVirtioPCIDevice *)d; > >> - return qpci_io_readw(dev->pdev, (void *)(uintptr_t)addr); > >> + uint16_t value; > >> + > >> + value =3D qpci_io_readw(dev->pdev, (void *)(uintptr_t)addr); > >> + if (target_big_endian()) { > >> + value =3D bswap16(value); > >> + } > >=20 > > Don't you need some sort of test to distinguish the virtio < 1.0 and > > virtio-1.0 cases? >=20 > yes, but for the moment we don't test virtio-1.0, we will add the test > when will support it. >=20 > http://wiki.qemu.org/Outreachy_2016_DecemberMarch#VIRTIO_1.0_support_in_l= ibqos Ok. Please drop a comment in though, to make one less mystery for whoever does end up adding the virtio 1.0 support. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --rQ2U398070+RC21q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX7isaAAoJEGw4ysog2bOSi80P/ji98e/9/hwBf95mqLBb/dYR bk0/jg+nylixp+Qy+lcB7mYaFyMb3FVQOzK64Vxsn1mTbUNKfm2xkzd2gG4Mz8BV k9vW+JgW/AAyRsPj1yfhlebR1VnnpqZYgHFJAnzJym3kGb2eQkdJSB6VnaqBogdv Qd8qcKv21LvLl/RlYTkUGQFMaYdb0NdjFtauoJ51rZ8qTataD2BMnI8F/YITLeKt GfXnc2OwCM/GyawTSwtX1CH48ru6DRkAz5xfSbZQMBtq8rYVO+gjBzrCZLP7R0dy 6iYWkrl1x0zE8D9iVwVtRQ8P8r5T3LP4zlLhF9oCS07M5hzS7+D8hGCmx3ncPaEG APz9QFJLq4CPdEcb4zw0SmHP2zVPAjccP4vXsksgfMAHl6ZU9BVEY5kAvs4SKPkq ptVeW/7H5kFb/iWzvXxwCu4A7sV/33VbioxVFo6NL/fNG+i/7KobxWLIZUu5qaIU Js28Wi5Kl74xPEotJhhAcJ9kpDtEcKfxDImElt3ILxvpfpxg8+PhNOubfnEFkWLO QGQ0KlWkF7MQ86TuWzgDQyBCPyLn8/YyCQ0k/Lah00B0M7wbyoqmBnKwC22BE6CJ MurTgXQK68fATmSHCKva2Qfsu3tS8RREp2CyAIhO03hOzeVGUnvn9rkBdyV8DidE Ww0O31/B9p8NxKK7p7c4 =2tJj -----END PGP SIGNATURE----- --rQ2U398070+RC21q--