mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
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:
committed by
Will Deacon
parent
57896feeda
commit
71ca0fac39
+2
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user