Despite allocating and providing code to handle accesses to the pba
structure, virtio msix blocks in fact only register the msix table with
kvm.

This patch fixes the MMIO region so that it includes the pba structure
for msix io blocks of virtio pci devices. The corresponding BAR is also
updated to advertise the full size of the io block.

Cc: Sasha Levin <sasha.le...@oracle.com>
Signed-off-by: Will Deacon <will.dea...@arm.com>
---
 tools/kvm/virtio/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index bb6e7c45e12a..91010cabbcde 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -322,7 +322,7 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct 
virtio_device *vdev,
                return r;
 
        vpci->base_addr = (u16)r;
-       r = kvm__register_mmio(kvm, vpci->msix_io_block, PCI_IO_SIZE, false,
+       r = kvm__register_mmio(kvm, vpci->msix_io_block, PCI_IO_SIZE * 2, false,
                               virtio_pci__mmio_callback, vpci);
        if (r < 0)
                goto free_ioport;
@@ -344,7 +344,7 @@ int virtio_pci__init(struct kvm *kvm, void *dev, struct 
virtio_device *vdev,
                .status                 = cpu_to_le16(PCI_STATUS_CAP_LIST),
                .capabilities           = (void *)&vpci->pci_hdr.msix - (void 
*)&vpci->pci_hdr,
                .bar_size[0]            = IOPORT_SIZE,
-               .bar_size[1]            = PCI_IO_SIZE,
+               .bar_size[1]            = PCI_IO_SIZE * 2,
                .bar_size[3]            = PCI_IO_SIZE,
        };
 
-- 
1.8.2.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to