From: Amos Kong <akong@redhat.com>
To: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
kvm@vger.kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org,
avi@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: fallback to userspace when there is no enough available ioeventfd
Date: Tue, 13 Mar 2012 18:42:40 +0800 [thread overview]
Message-ID: <20120313104240.8741.15753.stgit@dhcp-8-167.nay.redhat.com> (raw)
In-Reply-To: <20120313103602.8741.71939.stgit@dhcp-8-167.nay.redhat.com>
Qemu already supported multiple function devices, pci-bridge
would support more pci devices. But iobus dev in kernel are
limited. If there is no enough available ioeventfd, then
clean VIRTIO_PCI_FLAG_USE_IOEVENTFD bit, virtio-pci would
fallback to userspace.
Signed-off-by: Amos Kong <akong@redhat.com>
---
hw/virtio-pci.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index d63f303..d15b11b 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -322,6 +322,9 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
virtio_set_status(vdev, val & 0xFF);
if (val & VIRTIO_CONFIG_S_DRIVER_OK) {
+ if (kvm_has_many_ioeventfds() == 0) {
+ proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
+ }
virtio_pci_start_ioeventfd(proxy);
}
next prev parent reply other threads:[~2012-03-13 10:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 10:42 [Qemu-devel] [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd Amos Kong
2012-03-13 10:42 ` [Qemu-devel] [PATCH 1/2] return available ioeventfds count in kvm_has_many_ioeventfds() Amos Kong
2012-03-13 11:50 ` Jan Kiszka
2012-03-13 12:00 ` Amos Kong
2012-03-13 12:24 ` Jan Kiszka
2012-03-13 13:05 ` Amos Kong
2012-03-13 10:42 ` Amos Kong [this message]
2012-03-13 11:23 ` [Qemu-devel] [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd Stefan Hajnoczi
2012-03-13 11:51 ` Amos Kong
2012-03-13 14:30 ` Stefan Hajnoczi
2012-03-13 14:47 ` Amos Kong
2012-03-13 16:36 ` Stefan Hajnoczi
2012-03-14 0:30 ` Amos Kong
2012-03-14 8:57 ` Stefan Hajnoczi
2012-03-14 9:22 ` Avi Kivity
2012-03-14 9:59 ` Stefan Hajnoczi
2012-03-14 10:05 ` Avi Kivity
2012-03-14 10:39 ` Stefan Hajnoczi
2012-03-14 10:46 ` Avi Kivity
2012-03-14 11:46 ` Stefan Hajnoczi
2012-03-16 8:59 ` Amos Kong
2012-03-19 8:21 ` Stefan Hajnoczi
2012-03-19 10:11 ` Avi Kivity
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=20120313104240.8741.15753.stgit@dhcp-8-167.nay.redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).