Hi, This series adds XHCI "TR NOOP" support, but adding qtests ran into issues with PCI and MSIX, and fixing those irritated what looks like a bug in the e1000e/igb tests.
Firstly, the XHCI NEC PCI host has a shared BAR for device registers and MSIX space, which is not handled by qtest/pci. Keeping track of BAR mappings in qtest and allowing MSIX to use an existing mapping seems to work. For the XHCI qtest, I added a MSIX check to ensure interrupts are working correctly, similarly to e1000e it polls the PBA bit with the interrupt masked. Doing this never actually clears the pending msix irq, because that is not implemented in the hw/pci code. So a test that waits for an interrupt to be triggered multiple times will fail. Adding the PBA write operations to clear/trigger pending interrupts breaks e1000e/igb tests that wait for multiple triggers, because they are actually buggy and only triggering the irq once, but the missing MSIX write support was saving them because it made it look like the irq had triggered. My XHCI qtest caught that issue because it has some code which asserts that the interrupt is *not* pending. Since RFC I fixed up some checkpatch issues as Fabiano pointed out, and also dug into the e1000e/igb test failure a bit more and hopefully fixed it properly. Thanks, Nick Nicholas Piggin (8): qtest/pci: Enforce balanced iomap/unmap qtest/libqos/pci: Fix qpci_msix_enable sharing bar0 pci/msix: Implement PBA writes tests/qtest/e1000e|igb: Fix e1000e and igb tests to re-trigger interrupts hw/usb/xhci: Move HCD constants to a header and add register constants qtest/xhci: Add controller and device setup and ring tests hw/usb/xhci: Support TR NOOP commands qtest/xhci: add a test for TR NOOP commands hw/usb/hcd-xhci.h | 197 ++++++++++++ tests/qtest/libqos/ahci.h | 1 + tests/qtest/libqos/pci.h | 4 + tests/qtest/libqos/virtio-pci.h | 1 + hw/pci/msix.c | 16 + hw/usb/hcd-xhci.c | 318 ++++++------------- tests/qtest/ahci-test.c | 2 + tests/qtest/e1000e-test.c | 8 +- tests/qtest/igb-test.c | 8 +- tests/qtest/libqos/ahci.c | 6 + tests/qtest/libqos/e1000e.c | 2 +- tests/qtest/libqos/pci.c | 92 +++++- tests/qtest/libqos/virtio-pci.c | 6 +- tests/qtest/usb-hcd-xhci-test.c | 535 +++++++++++++++++++++++++++++++- 14 files changed, 943 insertions(+), 253 deletions(-) -- 2.45.2