From patchwork Fri Jun 10 06:12:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 867852 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5A6CLaD021289 for ; Fri, 10 Jun 2011 06:12:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752502Ab1FJGMT (ORCPT ); Fri, 10 Jun 2011 02:12:19 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:45034 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634Ab1FJGMS (ORCPT ); Fri, 10 Jun 2011 02:12:18 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate02.web.de (Postfix) with ESMTP id 566F81A2E3633; Fri, 10 Jun 2011 08:12:17 +0200 (CEST) Received: from [88.64.11.205] (helo=mchn199C.mchp.siemens.de) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QUux7-0007hW-00; Fri, 10 Jun 2011 08:12:17 +0200 Message-ID: <4DF1B5C0.2070301@web.de> Date: Fri, 10 Jun 2011 08:12:16 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Amos Kong CC: "Michael S. Tsirkin" , kvm@vger.kernel.org Subject: Re: current qemu-kvm doesn't work with vhost References: <20110610030844.GA3847@t400> In-Reply-To: <20110610030844.GA3847@t400> X-Enigmail-Version: 1.1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX19+GICE3lyoNG/1Y8vs++pQ3r+481OwQRe4j33v M4Ub6J1IFkPkHERJmRCetzvryaOe0E+79evvdMzFlzVkiS9W6R U3S77Y9Hc= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 10 Jun 2011 06:12:22 +0000 (UTC) On 2011-06-10 05:08, Amos Kong wrote: > host kernel: 2.6.39-rc2+ > qemu-kvm : 05f1737582ab6c075476bde931c5eafbc62a9349 > > (gdb) r -monitor stdio -m 800 ~/RHEL-Server-6.0-64-virtio.qcow2 -snapshot -device virtio-net-pci,netdev=he -netdev tap,vhost=on,id=he > > (qemu) [New Thread 0x7fffbe7dd700 (LWP 10410)] > [New Thread 0x7fffbdfdc700 (LWP 10411)] > qemu-kvm: /project/rh/qemu-kvm/hw/msix.c:616: msix_unset_mask_notifier: Assertion `dev->msix_mask_notifier' failed. > > Program received signal SIGABRT, Aborted. > [Switching to Thread 0x7ffff3233700 (LWP 10405)] > 0x00007ffff6593ba5 in raise () from /lib/libc.so.6 > (gdb) bt > #0 0x00007ffff6593ba5 in raise () from /lib/libc.so.6 > #1 0x00007ffff65976b0 in abort () from /lib/libc.so.6 > #2 0x00007ffff658ca71 in __assert_fail () from /lib/libc.so.6 > #3 0x00000000005754eb in msix_unset_mask_notifier (dev=0x1e56c50) at /project/rh/qemu-kvm/hw/msix.c:616 > #4 0x0000000000571ea4 in virtio_pci_set_guest_notifiers (opaque=0x1e56c50, assign=true) at /project/rh/qemu-kvm/hw/virtio-pci.c:674 > #5 0x000000000042c279 in vhost_dev_start (hdev=0x11c0420, vdev=0x1c40f10) at /project/rh/qemu-kvm/hw/vhost.c:710 > #6 0x0000000000429fe9 in vhost_net_start (net=0x11c0420, dev=0x1c40f10) at /project/rh/qemu-kvm/hw/vhost_net.c:142 > #7 0x0000000000425644 in virtio_net_vhost_status (n=0x1c40f10, status=7 '\a') at /project/rh/qemu-kvm/hw/virtio-net.c:127 > #8 0x00000000004256ec in virtio_net_set_status (vdev=0x1c40f10, status=7 '\a') at /project/rh/qemu-kvm/hw/virtio-net.c:144 > #9 0x00000000005709e6 in virtio_set_status (vdev=0x1c40f10, val=7 '\a') at /project/rh/qemu-kvm/hw/virtio.h:136 > #10 0x000000000057136f in virtio_ioport_write (opaque=0x1e56c50, addr=18, val=7) at /project/rh/qemu-kvm/hw/virtio-pci.c:338 > #11 0x00000000005717db in virtio_pci_config_writeb (opaque=0x1e56c50, addr=18, val=7) at /project/rh/qemu-kvm/hw/virtio-pci.c:462 > #12 0x000000000048409d in ioport_write (index=0, address=49202, data=7) at ioport.c:81 > #13 0x0000000000484756 in cpu_outb (addr=49202, val=7 '\a') at ioport.c:266 > #14 0x0000000000432dd2 in kvm_handle_io (port=49202, data=0x7ffff7ff3000, direction=1, size=1, count=1) at /project/rh/qemu-kvm/kvm-all.c:864 > #15 0x0000000000433266 in kvm_cpu_exec (env=0x188e5b0) at /project/rh/qemu-kvm/kvm-all.c:1008 > #16 0x00000000004091ef in qemu_kvm_cpu_thread_fn (arg=0x188e5b0) at /project/rh/qemu-kvm/cpus.c:808 > #17 0x00007ffff79be971 in start_thread () from /lib/libpthread.so.0 > #18 0x00007ffff664692d in clone () from /lib/libc.so.6 > #19 0x0000000000000000 in ?? () I already came across that symptom in a different context. Fixed by the patch below. However, the real issue is related to an upstream cleanup of the virtio-pci build. That reveals some unneeded build dependencies in qemu-kvm. Will post a fix. Jan -----8<----- From: Jan Kiszka qemu-kvm: Fix error path of virtio_pci_set_guest_notifiers The mask notifier is never installed on error, so this deinstallation will just trigger an assert in msix_unset_mask_notifier. Signed-off-by: Jan Kiszka --- hw/virtio-pci.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c4735c5..311c47b 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -688,10 +688,6 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign) assign_error: /* We get here on assignment failure. Recover by undoing for VQs 0 .. n. */ - if (assign) { - msix_unset_mask_notifier(&proxy->pci_dev); - } - while (--n >= 0) { virtio_pci_set_guest_notifier(opaque, n, !assign); }