[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/71] tests/libqos: has_buggy_msi flag
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 32/71] tests/libqos: has_buggy_msi flag |
Date: |
Mon, 3 Dec 2018 16:32:45 +0100 |
From: Emanuele Giuseppe Esposito <address@hidden>
The Qgraph framework makes any test using
pci bus run the same function using pci-pci and
pci-spapr bus. However, some tests are not ready to use
the spapr bus, due to a MSI bug. Until it does not get
fixed, this flag allows them to skip the test
Signed-off-by: Emanuele Giuseppe Esposito <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/libqos/pci-pc.c | 3 +++
tests/libqos/pci-spapr.c | 3 +++
tests/libqos/pci.c | 14 ++++++++++++++
tests/libqos/pci.h | 4 ++++
4 files changed, 24 insertions(+)
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 041bfed..4247cda 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -123,6 +123,9 @@ void qpci_init_pc(QPCIBusPC *qpci, QTestState *qts,
QGuestAllocator *alloc)
{
assert(qts);
+ /* tests can use pci-bus */
+ qpci->bus.has_buggy_msi = FALSE;
+
qpci->bus.pio_readb = qpci_pc_pio_readb;
qpci->bus.pio_readw = qpci_pc_pio_readw;
qpci->bus.pio_readl = qpci_pc_pio_readl;
diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
index 24f2c2c..502a0e5 100644
--- a/tests/libqos/pci-spapr.c
+++ b/tests/libqos/pci-spapr.c
@@ -155,6 +155,9 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
{
assert(qts);
+ /* tests cannot use spapr, needs to be fixed first */
+ qpci->bus.has_buggy_msi = TRUE;
+
qpci->alloc = alloc;
qpci->bus.pio_readb = qpci_spapr_pio_readb;
diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c
index 8257904..662ee7a 100644
--- a/tests/libqos/pci.c
+++ b/tests/libqos/pci.c
@@ -51,6 +51,20 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int
device_id,
}
}
+bool qpci_has_buggy_msi(QPCIDevice *dev)
+{
+ return dev->bus->has_buggy_msi;
+}
+
+bool qpci_check_buggy_msi(QPCIDevice *dev)
+{
+ if (qpci_has_buggy_msi(dev)) {
+ g_test_skip("Skipping due to incomplete support for MSI");
+ return true;
+ }
+ return false;
+}
+
static void qpci_device_set(QPCIDevice *dev, QPCIBus *bus, int devfn)
{
g_assert(dev);
diff --git a/tests/libqos/pci.h b/tests/libqos/pci.h
index 9fd521a..8e1d292 100644
--- a/tests/libqos/pci.h
+++ b/tests/libqos/pci.h
@@ -53,6 +53,7 @@ struct QPCIBus {
QTestState *qts;
uint16_t pio_alloc_ptr;
uint64_t mmio_alloc_ptr, mmio_limit;
+ bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */
};
@@ -81,6 +82,9 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int
device_id,
QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn);
void qpci_device_init(QPCIDevice *dev, QPCIBus *bus, QPCIAddress *addr);
+bool qpci_has_buggy_msi(QPCIDevice *dev);
+bool qpci_check_buggy_msi(QPCIDevice *dev);
+
void qpci_device_enable(QPCIDevice *dev);
uint8_t qpci_find_capability(QPCIDevice *dev, uint8_t id);
void qpci_msix_enable(QPCIDevice *dev);
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 19/71] tests: qgraph API for the qtest driver framework, (continued)
[Qemu-devel] [PATCH 25/71] tests/libqos: arm/sabrelite machine node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 27/71] tests/libqos: aarch64/xlnx-zcu102 machine node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 26/71] tests/libqos: arm/xilinx-zynq-a9 machine node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 29/71] tests/qgraph: add generic PCI testcases, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 31/71] tests/qgraph: ppc64/pseries machine node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 32/71] tests/libqos: has_buggy_msi flag,
Paolo Bonzini <=
[Qemu-devel] [PATCH 33/71] tests/libqos: e1000e driver and interface nodes, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 35/71] tests/libqos: virtio-pci driver and interface nodes, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 37/71] tests/libqos: virtio-mmio driver and interface nodes, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 38/71] tests/libqos: arm/virt machine node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 36/71] tests/libqos: remove global_qtest from virtio endianness checks, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 34/71] qos-test: e1000e test node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 39/71] tests/qgraph: add generic virtio testcases, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 41/71] qos-test: virtio-console and virtio-serial test node, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 42/71] tests/libqos: virtio-9p driver and interface nodes, Paolo Bonzini, 2018/12/03
[Qemu-devel] [PATCH 40/71] tests/libqos: virtio-serial driver and interface nodes, Paolo Bonzini, 2018/12/03