public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Yu <raise.sail@gmail.com>
To: kvm@vger.kernel.org
Subject: [PATCH] kvmtool: fix wrong bus type and width in KVM_IOEVENTFD ioctl() call on MMIO bus
Date: Wed, 01 Apr 2015 17:27:49 +0800	[thread overview]
Message-ID: <551BBA15.4080409@gmail.com> (raw)

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;

                 reply	other threads:[~2015-04-01  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551BBA15.4080409@gmail.com \
    --to=raise.sail@gmail.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox