qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] tests: enable virtio tests on SP


From: David Gibson
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] tests: enable virtio tests on SPAPR
Date: Fri, 30 Sep 2016 19:06:34 +1000
User-agent: Mutt/1.7.0 (2016-08-17)

On Fri, Sep 30, 2016 at 08:59:39AM +0200, Laurent Vivier wrote:
> 
> 
> 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 <address@hidden>
> >> ---
> >>  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 += tests/usb-hcd-uhci-test$(EXESUF)
> >>  gcov-files-ppc64-y += hw/usb/hcd-uhci.c
> >>  check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF)
> >>  gcov-files-ppc64-y += hw/usb/hcd-xhci.c
> >> +check-qtest-ppc64-y += $(check-qtest-virtio-y)
> >>  
> >>  check-qtest-sh4-y = tests/endianness-test$(EXESUF)
> >>  
> >> @@ -604,7 +605,7 @@ libqos-pc-obj-y += tests/libqos/ahci.o
> >>  libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
> >>  libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o
> >>  libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) 
> >> tests/libqos/usb.o
> >> -libqos-virtio-obj-y = $(libqos-pc-obj-y) tests/libqos/virtio.o 
> >> tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o 
> >> tests/libqos/malloc-generic.o
> >> +libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) 
> >> tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o 
> >> tests/libqos/malloc-generic.o
> >>  
> >>  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(QVirtioDevice 
> >> *d, uint64_t addr)
> >>      return qpci_io_readb(dev->pdev, (void *)(uintptr_t)addr);
> >>  }
> >>  
> >> +/* 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 addr)
> >>  {
> >>      QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
> >> -    return qpci_io_readw(dev->pdev, (void *)(uintptr_t)addr);
> >> +    uint16_t value;
> >> +
> >> +    value = qpci_io_readw(dev->pdev, (void *)(uintptr_t)addr);
> >> +    if (target_big_endian()) {
> >> +        value = bswap16(value);
> >> +    }
> > 
> > Don't you need some sort of test to distinguish the virtio < 1.0 and
> > virtio-1.0 cases?
> 
> yes, but for the moment we don't test virtio-1.0, we will add the test
> when will support it.
> 
> http://wiki.qemu.org/Outreachy_2016_DecemberMarch#VIRTIO_1.0_support_in_libqos

Ok.  Please drop a comment in though, to make one less mystery for
whoever does end up adding the virtio 1.0 support.

-- 
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

Attachment: signature.asc
Description: PGP signature


reply via email to

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