public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvmtool: fix wrong bus type and width in KVM_IOEVENTFD ioctl() call on MMIO bus
@ 2015-04-01  9:27 Li Yu
  0 siblings, 0 replies; only message in thread
From: Li Yu @ 2015-04-01  9:27 UTC (permalink / raw)
  To: kvm

This patch is to fix wrong parameters of ioctl(KVM_IOEVENTFD) calls, 
otherwise
macvtap + vhost-net is broken, that is:

1. we should register these address range on MMIO bus instead of PIO bus.
2. the register VIRTIO_PCI_QUEUE_NOTIFY should be 16-bits width.

Signed-off-by: Yu Li <raise.sail@gmail.com>

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index 7556239..fcf8e93 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -57,8 +57,9 @@ static int virtio_pci__init_ioeventfd(struct kvm *kvm, 
struct virtio_device *vde

  	/* mmio */
  	ioevent.io_addr	= vpci->mmio_addr + VIRTIO_PCI_QUEUE_NOTIFY;
-	ioevent.io_len	= sizeof(u32);
+	ioevent.io_len	= sizeof(u16);
  	ioevent.fd	= fds[1] = eventfd(0, 0);
+	flags &= ~IOEVENTFD_FLAG_PIO;
  	r = ioeventfd__add_event(&ioevent, flags);
  	if (r)
  		goto free_ioport_evt;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-01  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01  9:27 [PATCH] kvmtool: fix wrong bus type and width in KVM_IOEVENTFD ioctl() call on MMIO bus Li Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox