All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: "'Michael S. Tsirkin'" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not	support eventfds
Date: Mon, 16 Nov 2015 10:02:07 +0300	[thread overview]
Message-ID: <007f01d1203c$b55d9230$2018b690$@samsung.com> (raw)
In-Reply-To: <20151114211725-mutt-send-email-mst@redhat.com>

 Hello!

> > If you happen to have a stock kernel of old version, like 3.x, and you
> > attempt to enable vhost by setting vhost=on, qemu aborts with error:
> >
> > kvm_mem_ioeventfd_add: error adding ioeventfd: Function not implemented
> >
> > This patch adds capability check, so that vhost gets disabled instead. A
> > warning is displayed, explaining the reason.
> >
> > This problem can be observed with libvirt, which checks for /dev/vhost-net
> > availability and just inserts "vhost=on" automatically in this case.
> >
> > Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
> 
> How come you have /dev/vhost-net though?

 Easily. Just enable CONFIG_VHOST_NET for the kernel. I happened to have it because i just copied over .config from another kernel
version, which had ioeventfds working.
 CONFIG_VHOST_NET in the kernel depends on CONFIG_VHOST, which in turn depends on CONFIG_EVENTFD. But there's no direct dependency
between it and CONFIG_HAVE_KVM_EVENTFD. So, you can just enable CONFIG_IOEVENTFD in "Configure standard kernel features", and get
ioeventfds by themselves with vhost-net. Which, technically speaking, has no direct dependency on KVM's ability to bind ioeventfd to
memory accesses. Because, theoretically, you could have some other use for it.

> That was supposed to only be there if you have vhost-net,
> and that never existed on kernels without eventfd.

 I believe distro maintainers (should) have taken care of it and disable it. But, as you can see, in some circumstances you could
have it enabled. IMHO it's better to be more flexible and process this situation correctly. The fix is trivial.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

  reply	other threads:[~2015-11-16  7:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13  9:28 [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds Pavel Fedin
2015-11-14 19:18 ` Michael S. Tsirkin
2015-11-16  7:02   ` Pavel Fedin [this message]
2015-11-16  7:16     ` Michael S. Tsirkin
2015-11-16  7:31       ` Pavel Fedin
2015-11-16 14:34 ` Christian Borntraeger

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='007f01d1203c$b55d9230$2018b690$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.