From patchwork Mon Jan 31 15:28:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 81145 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 1DFD8B70AF for ; Tue, 1 Feb 2011 02:37:01 +1100 (EST) Received: from localhost ([127.0.0.1]:44062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjvoD-0006wY-B3 for incoming@patchwork.ozlabs.org; Mon, 31 Jan 2011 10:36:53 -0500 Received: from [140.186.70.92] (port=42899 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjvfY-0002as-Ss for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:27:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjvfP-0003Pj-Mr for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:27:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjvfP-0003Pd-Fw for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:27:47 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0VFRkiU010591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 31 Jan 2011 10:27:46 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0VFRZ26012144; Mon, 31 Jan 2011 10:27:45 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 31 Jan 2011 16:28:56 +0100 Message-Id: <1296487756-12553-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1296487756-12553-1-git-send-email-kwolf@redhat.com> References: <1296487756-12553-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 08/28] 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 From: Stefan Hajnoczi 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 Acked-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf --- kvm-all.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 255b6fa..8f0e17c 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 io notification. 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++) {