aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/virtio-pci.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2019-10-23 11:04:25 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-10-25 07:46:22 -0400
commitd08f68b8e858fc761e88ae66349b6eab1235e3fe (patch)
treeab779d3734554f4107c9f7d11240a73d7796cbbb /tests/libqos/virtio-pci.h
parent9598f9e4023cc4b0f1f4c4964e4d0debc30cc77c (diff)
libqos: add VIRTIO PCI 1.0 support
Implement the VIRTIO 1.0 virtio-pci interface. The main change here is that the register layout is no longer a fixed layout in BAR 0. Instead we have to iterate of PCI Capabilities to find descriptions of where various registers are located. The vring registers are also more fine-grained, allowing for more flexible vring layouts, but we don't take advantage of that. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Message-Id: <20191023100425.12168-17-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/libqos/virtio-pci.h')
-rw-r--r--tests/libqos/virtio-pci.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/libqos/virtio-pci.h b/tests/libqos/virtio-pci.h
index 6b3a385b06..294d5567ee 100644
--- a/tests/libqos/virtio-pci.h
+++ b/tests/libqos/virtio-pci.h
@@ -27,6 +27,13 @@ typedef struct QVirtioPCIDevice {
uint32_t config_msix_data;
int bar_idx;
+
+ /* VIRTIO 1.0 */
+ uint32_t common_cfg_offset;
+ uint32_t notify_cfg_offset;
+ uint32_t notify_off_multiplier;
+ uint32_t isr_cfg_offset;
+ uint32_t device_cfg_offset;
} QVirtioPCIDevice;
struct QVirtioPCIMSIXOps {
@@ -43,6 +50,9 @@ typedef struct QVirtQueuePCI {
uint16_t msix_entry;
uint64_t msix_addr;
uint32_t msix_data;
+
+ /* VIRTIO 1.0 */
+ uint64_t notify_offset;
} QVirtQueuePCI;
void virtio_pci_init(QVirtioPCIDevice *dev, QPCIBus *bus, QPCIAddress * addr);