From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aFO-0002wD-RN for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:41:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9aFJ-0001F6-Cv for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:41:22 -0400 Received: from indium.canonical.com ([91.189.90.7]:50664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aFJ-0001Eb-78 for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:41:17 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1Z9aFI-0006DI-6k for ; Mon, 29 Jun 2015 14:41:16 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 3176C2E80C1 for ; Mon, 29 Jun 2015 14:41:16 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 29 Jun 2015 14:34:17 -0000 From: Li Chengyuan Sender: bounces@canonical.com References: <20150617052649.30965.88731.malonedeb@wampee.canonical.com> Message-Id: <20150629143417.15568.75734.malone@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1465935] Re: kvm_irqchip_commit_routes: Assertion `ret == 0' failed Reply-To: Bug 1465935 <1465935@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org >>From kvm_pc_setup_irq_routing() function, we can see that 15 routes from PIC and 23 routes from IOAPIC are added into irq route table, but only 23 irq(gsi) are reserved. This leads to irq route table has been full but there are still tens of free gsi. So the "retry" part of kvm_irqchip_get_virq() shall never have chance to be executed. void kvm_pc_setup_irq_routing(bool pci_enabled) { KVMState *s =3D kvm_state; int i; if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { for (i =3D 0; i < 8; ++i) { if (i =3D=3D 2) { continue; } kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i); } for (i =3D 8; i < 16; ++i) { kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8); } if (pci_enabled) { for (i =3D 0; i < 24; ++i) { if (i =3D=3D 0) { kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2); } else if (i !=3D 2) { kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i); } } } kvm_irqchip_commit_routes(s); } } static int kvm_irqchip_get_virq(KVMState *s) { uint32_t *word =3D s->used_gsi_bitmap; int max_words =3D ALIGN(s->gsi_count, 32) / 32; int i, bit; bool retry =3D true; again: /* Return the lowest unused GSI in the bitmap */ for (i =3D 0; i < max_words; i++) { bit =3D ffs(~word[i]); if (!bit) { continue; } return bit - 1 + i * 32; } if (!s->direct_msi && retry) { retry =3D false; kvm_flush_dynamic_msi_routes(s); goto again; } return -ENOSPC; } -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1465935 Title: kvm_irqchip_commit_routes: Assertion `ret =3D=3D 0' failed Status in QEMU: New Status in qemu package in Ubuntu: New Bug description: Several my QEMU instances crashed, and in the qemu log, I can see this assertion failure, qemu-system-x86_64: /build/buildd/qemu-2.0.0+dfsg/kvm-all.c:984: kvm_irqchip_commit_routes: Assertion `ret =3D=3D 0' failed. The QEMU version is 2.0.0, HV OS is ubuntu 12.04, kernel 3.2.0-38. Guest OS is RHEL 6.3. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1465935/+subscriptions