summaryrefslogtreecommitdiff
path: root/tests/libqos
AgeCommit message (Collapse)AuthorFilesLines
2014-08-15libqos: Change free function called in mallocMarc Marí1-1/+1
Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-15libqos: Correct mask to align size to PAGE_SIZE in malloc-pcMarc Marí1-1/+1
Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-15libqos: allow qpci_iomap to return BAR mapping sizeJohn Snow3-5/+8
This patch allows qpci_iomap to return the size of the BAR mapping that it created, to allow driver applications (e.g, ahci-test) to make determinations about the suitability or the mapping size, or in the specific case of AHCI, how many ports are supported by the HBA. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-15libqos: Fixes a small memory leak.John Snow2-0/+8
Allow users the chance to clean up the QPCIBusPC structure by adding a small cleanup routine. Helps clear up small memory leaks during setup/teardown, to allow for cleaner debug output messages. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-15libqos: Correct memory leakJohn Snow1-0/+3
Fix a small memory leak inside of libqos, in the pc_alloc_init routine. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-15libqos: Fix PC PCI endianness glitchesAndreas Färber1-6/+6
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>
2014-06-02qtest: fix qpci_config_writelGerd Hoffmann1-1/+1
Found by Paolo. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-03-27tests/libqos/pci-pc: Avoid shifting left into sign bitPeter Maydell1-6/+6
Add U suffix when doing "1 << 31" to avoid undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-07-18libqos: Generalize I/O-mapped fw_cfgMarkus Armbruster5-61/+33
Provide a constructor that takes the base address in addition to the PC-specific one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-12-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-18libqos: Add support for memory-mapped fw_cfgMarkus Armbruster2-0/+32
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08libqos/pci: Enable bus masteringKevin Wolf1-1/+1
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-03libqos: Relocate I2C filesAndreas Färber3-0/+225
Commit c4efe1cada311b9dc0df5beb71c4227ff3414aa1 (qtest: add libqos including PCI support) created a libqos/ subdirectory but left the existing I2C libqos files libi2c*.[hc] in tests/. Clean this up. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367502986-15104-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-29libqos: Convert fw_cfg values to host endiannessAndreas Färber1-3/+4
The fw_cfg ABI is Little Endian, so byte-swap the generically read byte array to host endianness. This unbreaks the fw_cfg tests on ppc. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367167547-19931-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17libqos: add malloc supportAnthony Liguori3-0/+129
This is a very simple allocator for the PC platform. It should be possible to add backends for other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-5-git-send-email-aliguori@us.ibm.com
2013-04-17libqos: add fw_cfg supportAnthony Liguori4-0/+145
fw_cfg is needed to get the top of memory which is necessary for doing PCI allocation and allocating RAM for DMA. Add a PC version of fw_cfg and enough abstraction to support other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-4-git-send-email-aliguori@us.ibm.com
2013-04-17qtest: add libqos including PCI supportAnthony Liguori4-0/+490
This includes basic PCI support for the PC platform. Enough abstraction should be present to support non-PC platforms too. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-3-git-send-email-aliguori@us.ibm.com