From patchwork Tue Jan 25 14:53:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 80375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3E53D1007D1 for ; Wed, 26 Jan 2011 02:25:43 +1100 (EST) Received: from localhost ([127.0.0.1]:54357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Phkm3-0001t1-Qd for incoming@patchwork.ozlabs.org; Tue, 25 Jan 2011 10:25:39 -0500 Received: from [140.186.70.92] (port=47655 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhkHd-0005BJ-2J for qemu-devel@nongnu.org; Tue, 25 Jan 2011 09:56:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhkHV-0004i0-8Q for qemu-devel@nongnu.org; Tue, 25 Jan 2011 09:54:06 -0500 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:45613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhkHU-0004hb-US for qemu-devel@nongnu.org; Tue, 25 Jan 2011 09:54:05 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0PErj5I007148 for ; Tue, 25 Jan 2011 14:53:45 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0PErlK61872046 for ; Tue, 25 Jan 2011 14:53:47 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0PEriN8019746 for ; Tue, 25 Jan 2011 07:53:45 -0700 Received: from stefanha-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-24.manchester-maybrook.uk.ibm.com [9.174.219.24]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0PErikt019734; Tue, 25 Jan 2011 07:53:44 -0700 From: Stefan Hajnoczi To: Date: Tue, 25 Jan 2011 14:53:31 +0000 Message-Id: <1295967211-362-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Kevin Wolf , Stefan Hajnoczi , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v2] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It is not possible to use virtio-ioeventfd when building without an I/O thread. We rely on a signal to kick us out of vcpu execution. Timers and AIO use SIGALRM and SIGUSR2 respectively. Unfortunately eventfd does not support O_ASYNC (SIGIO) so eventfd cannot be used in a signal driven manner. Signed-off-by: Stefan Hajnoczi --- kvm-all.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 255b6fa..881ea32 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -449,10 +449,14 @@ int kvm_check_extension(KVMState *s, unsigned int extension) static int kvm_check_many_ioeventfds(void) { - /* Older kernels have a 6 device limit on the KVM io bus. Find out so we + /* Userspace can use ioeventfd for virtqueue kick. This requires a host + * that supports eventfd(2) and an I/O thread; since eventfd does not + * support SIGIO it cannot interrupt the vcpu. + * + * Older kernels have a 6 device limit on the KVM io bus. Find out so we * can avoid creating too many ioeventfds. */ -#ifdef CONFIG_EVENTFD +#if defined(CONFIG_EVENTFD) && defined(CONFIG_IOTHREAD) int ioeventfds[7]; int i, ret = 0; for (i = 0; i < ARRAY_SIZE(ioeventfds); i++) {