From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyDnt-0002TP-2R for qemu-devel@nongnu.org; Mon, 16 Nov 2015 02:02:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyDnp-0007Bp-R5 for qemu-devel@nongnu.org; Mon, 16 Nov 2015 02:02:16 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:47358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyDnp-00079v-Ld for qemu-devel@nongnu.org; Mon, 16 Nov 2015 02:02:13 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXW00FY1BJKDV60@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Mon, 16 Nov 2015 07:02:08 +0000 (GMT) From: Pavel Fedin References: <002301d11df5$9d440a10$d7cc1e30$@samsung.com> <20151114211725-mutt-send-email-mst@redhat.com> In-reply-to: <20151114211725-mutt-send-email-mst@redhat.com> Date: Mon, 16 Nov 2015 10:02:07 +0300 Message-id: <007f01d1203c$b55d9230$2018b690$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ru Subject: Re: [Qemu-devel] [PATCH] vhost: Fix aborting if KVM does not support eventfds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "'Michael S. Tsirkin'" Cc: qemu-devel@nongnu.org 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 > > 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