From patchwork Tue Sep 11 21:26:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 183205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 256B92C0078 for ; Wed, 12 Sep 2012 07:49:26 +1000 (EST) Received: from localhost ([::1]:51815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBXzz-0006CS-As for incoming@patchwork.ozlabs.org; Tue, 11 Sep 2012 17:27:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBXzD-000413-8y for qemu-devel@nongnu.org; Tue, 11 Sep 2012 17:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBXzB-0008VK-2z for qemu-devel@nongnu.org; Tue, 11 Sep 2012 17:27:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBXzA-0008UM-QU for qemu-devel@nongnu.org; Tue, 11 Sep 2012 17:27:08 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8BLR6fs005755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Sep 2012 17:27:06 -0400 Received: from amt.cnet (vpn1-6-223.gru2.redhat.com [10.97.6.223]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8BLR5KP016187; Tue, 11 Sep 2012 17:27:06 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id C2121656074; Tue, 11 Sep 2012 18:26:59 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.5/8.14.5/Submit) id q8BLQxLX029409; Tue, 11 Sep 2012 18:26:59 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Tue, 11 Sep 2012 18:26:30 -0300 Message-Id: <8732fbd2afce18afc429da2ad76df7c48b4bac4b.1347398795.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Peter Maydell , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 2/9] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Maydell Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for architectures that support async interrupt notification even without an in kernel irqchip). Signed-off-by: Peter Maydell Signed-off-by: Marcelo Tosatti --- kvm-all.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 39cff55..f9873db 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1237,10 +1237,6 @@ static int kvm_irqchip_create(KVMState *s) return ret; } - s->irqchip_inject_ioctl = KVM_IRQ_LINE; - if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { - s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS; - } kvm_kernel_irqchip = true; /* If we have an in-kernel IRQ chip then we must have asynchronous * interrupt delivery (though the reverse is not necessarily true) @@ -1389,6 +1385,11 @@ int kvm_init(void) s->intx_set_mask = kvm_check_extension(s, KVM_CAP_PCI_2_3); + s->irqchip_inject_ioctl = KVM_IRQ_LINE; + if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { + s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS; + } + ret = kvm_arch_init(s); if (ret < 0) { goto err;