diff options
author | Stefan Hajnoczi | 2019-10-23 12:04:20 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2019-10-25 13:46:22 +0200 |
commit | 1e59a866100caf205782334bf7f7a40f28fd23be (patch) | |
tree | 07eb23c475e1ca2cde4ebd2661ece4fcb2944f8a /tests/libqos/virtio-pci.c | |
parent | libqos: add iteration support to qpci_find_capability() (diff) | |
download | qemu-1e59a866100caf205782334bf7f7a40f28fd23be.tar.gz qemu-1e59a866100caf205782334bf7f7a40f28fd23be.tar.xz qemu-1e59a866100caf205782334bf7f7a40f28fd23be.zip |
libqos: pass full QVirtQueue to set_queue_address()
Instead of just passing the vring page frame number, pass the full
QVirtQueue. This will allow the VIRTIO 1.0 transport to program the
fine-grained vring address registers in the future.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191023100425.12168-12-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/libqos/virtio-pci.c')
-rw-r--r-- | tests/libqos/virtio-pci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c index 7ecf5d0a52..e4fa318dcc 100644 --- a/tests/libqos/virtio-pci.c +++ b/tests/libqos/virtio-pci.c @@ -199,9 +199,11 @@ static uint16_t qvirtio_pci_get_queue_size(QVirtioDevice *d) return qpci_io_readw(dev->pdev, dev->bar, VIRTIO_PCI_QUEUE_NUM); } -static void qvirtio_pci_set_queue_address(QVirtioDevice *d, uint32_t pfn) +static void qvirtio_pci_set_queue_address(QVirtioDevice *d, QVirtQueue *vq) { QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev); + uint64_t pfn = vq->desc / VIRTIO_PCI_VRING_ALIGN; + qpci_io_writel(dev->pdev, dev->bar, VIRTIO_PCI_QUEUE_PFN, pfn); } @@ -239,7 +241,7 @@ static QVirtQueue *qvirtio_pci_virtqueue_setup(QVirtioDevice *d, addr = guest_alloc(alloc, qvring_size(vqpci->vq.size, VIRTIO_PCI_VRING_ALIGN)); qvring_init(qvpcidev->pdev->bus->qts, alloc, &vqpci->vq, addr); - qvirtio_pci_set_queue_address(d, vqpci->vq.desc / VIRTIO_PCI_VRING_ALIGN); + qvirtio_pci_set_queue_address(d, &vqpci->vq); return &vqpci->vq; } |