From patchwork Wed Aug 15 11:08:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10756 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 86E1B23E00 for ; Wed, 15 Aug 2012 11:08:23 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 42B43A18863 for ; Wed, 15 Aug 2012 11:08:23 +0000 (UTC) Received: by yenl8 with SMTP id l8so1725117yen.11 for ; Wed, 15 Aug 2012 04:08:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=jxQhiq7WUixNMu1G7Q/WtO5xre5GiAgiPjPewDeBsjk=; b=bs3wOZ1VfZTOyQzrtcsph+y5qpK85nynvf0KMS01aeAAjlwruSo5iL0yaHrN/WL1tj NUW5u86SFk4NQqlveSVna1NeOFe1hg+gbLee+GQWTxJZIpqfzWa5i/9yXvjKUuDgjNCb rnnk+hjrDvi61Hn9gppSTwcxNhETD8YHc0174UEjpeqnmvN5zuDQ7NJX5GBJH1LoM2GQ 0a3RetOl0uK89sISgw80EMKjTmBVjQ8Zarn8J31trBZ6LjXqhP9d5pONZ93YItDsP7V9 Tl1cLU0FjsZM4mLk6v4MyBa0deoVFhaieueJACJhkTo5Fso2WKzu3tb1ugeJq8HE5gkD U77A== Received: by 10.50.94.133 with SMTP id dc5mr17705900igb.16.1345028902499; Wed, 15 Aug 2012 04:08:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp62099igc; Wed, 15 Aug 2012 04:08:21 -0700 (PDT) Received: by 10.14.210.132 with SMTP id u4mr23764845eeo.6.1345028900086; Wed, 15 Aug 2012 04:08:20 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id f45si717249eep.45.2012.08.15.04.08.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Aug 2012 04:08:19 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1T1bSP-0000cx-BX; Wed, 15 Aug 2012 12:08:13 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Avi Kivity , Marcelo Tosatti , Jan Kiszka , kvm@vger.kernel.org Subject: [PATCH v2] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() Date: Wed, 15 Aug 2012 12:08:13 +0100 Message-Id: <1345028893-2388-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQme/3EgspYn/DvSvk4YhZHlZbqDPYzUjLiPFxfb8gDwNvyPIrsPOrC+PADibWlQVVZGFnjc 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 --- Changes v1->v2: move whe whole chunk of init code, for both KVM_IRQ_LINE and KVM_IRQ_LINE_STATUS possibilities. kvm-all.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 34b02c1..72d84a2 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1200,10 +1200,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) @@ -1350,6 +1346,11 @@ int kvm_init(void) s->direct_msi = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0); #endif + 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;