kvmtool: vhost-net: fix ioeventfd registration

On registering the ioeventfds for the virtio-pci device we cover both
the I/O ports and the MMIO BAR.
But as the current code advertises both as PIO, the host kernel gets
the wrong bus number for the MMIO region.
Fix the issue by marking only the actual PIO area as PIO.
This fixes vhost-net on x86.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
Andre Przywara
2015-06-26 14:31:48 +01:00
committed by Will Deacon
parent 57896feeda
commit 71ca0fac39
+2 -2
View File
@@ -25,7 +25,7 @@ static int virtio_pci__init_ioeventfd(struct kvm *kvm, struct virtio_device *vde
{
struct ioevent ioevent;
struct virtio_pci *vpci = vdev->virtio;
int i, r, flags = IOEVENTFD_FLAG_PIO;
int i, r, flags = 0;
int fds[2];
vpci->ioeventfds[vq] = (struct virtio_pci_ioevent_param) {
@@ -51,7 +51,7 @@ static int virtio_pci__init_ioeventfd(struct kvm *kvm, struct virtio_device *vde
ioevent.io_addr = vpci->port_addr + VIRTIO_PCI_QUEUE_NOTIFY;
ioevent.io_len = sizeof(u16);
ioevent.fd = fds[0] = eventfd(0, 0);
r = ioeventfd__add_event(&ioevent, flags);
r = ioeventfd__add_event(&ioevent, flags | IOEVENTFD_FLAG_PIO);
if (r)
return r;