[PATCH 01/17] kvm tools: pci: register virtio pba structure as mmio region with kvm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.levin@xxxxxxxxxx>
Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux