From patchwork Tue Jan 23 12:47:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 10180151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3634F601D5 for ; Tue, 23 Jan 2018 12:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E21B9201A4 for ; Tue, 23 Jan 2018 12:50:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DDA628708; Tue, 23 Jan 2018 12:50:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 843D828776 for ; Tue, 23 Jan 2018 12:49:08 +0000 (UTC) Received: from localhost ([::1]:56311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edy0h-0006Fg-8f for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jan 2018 07:49:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edxza-0005V3-Bn for qemu-devel@nongnu.org; Tue, 23 Jan 2018 07:48:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edxzX-0003K3-4H for qemu-devel@nongnu.org; Tue, 23 Jan 2018 07:47:58 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edxzW-0003JZ-RO for qemu-devel@nongnu.org; Tue, 23 Jan 2018 07:47:55 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0NCkFPi101515 for ; Tue, 23 Jan 2018 07:47:52 -0500 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fp2wae93c-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Jan 2018 07:47:51 -0500 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jan 2018 07:47:50 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jan 2018 07:47:47 -0500 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0NCllLa49414230; Tue, 23 Jan 2018 12:47:47 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEE5DAE034; Tue, 23 Jan 2018 07:49:01 -0500 (EST) Received: from [9.85.156.129] (unknown [9.85.156.129]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 20228AE04B; Tue, 23 Jan 2018 07:49:00 -0500 (EST) To: joserz@linux.vnet.ibm.com, ghammer@redhat.com, mst@redhat.com References: <20180123030528.GA5780@pacoca> <20180123123404.GA3765@pacoca.br.ibm.com> From: Daniel Henrique Barboza Date: Tue, 23 Jan 2018 10:47:45 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180123123404.GA3765@pacoca.br.ibm.com> Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18012312-2213-0000-0000-0000026060C1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008413; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00979181; UDB=6.00496279; IPR=6.00758486; BA=6.00005791; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019165; XFM=3.00000015; UTC=2018-01-23 12:47:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012312-2214-0000-0000-000058DD82B6 Message-Id: <2db504dd-fe54-b3e7-6121-ef5f6d6dd74a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-23_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801230175 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id w0NCkFPi101515 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: Re: [Qemu-devel] virtio block device is not working X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Yeah, the problem looks like in virtio-pci-net. This is the output when running in a Power 9 host: sudo ./qemu-system-ppc64 -nographic -vga none -m 4G -M pseries,accel=kvm -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0 SLOF ********************************************************************** QEMU Starting  Build Date = Dec 18 2017 13:08:00  FW Version = git-fa981320a1e0968d  Press "s" to enter Open Firmware. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /vdevice/v-scsi@71000002        SCSI: Looking for devices           8200000000000000 CD-ROM   : "QEMU     QEMU CD-ROM 2.5+" Populating /pci@800000020000000                      00 0000 (D) : 1af4 1000    virtio [ net ] Aborted As Ziviani mentioned, reverting 4fe6d78b2e fixes it: $ git diff $ sudo ./qemu-system-ppc64 -nographic -vga none -m 4G -M pseries,accel=kvm -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0 SLOF ********************************************************************** QEMU Starting  Build Date = Dec 18 2017 13:08:00  FW Version = git-fa981320a1e0968d  Press "s" to enter Open Firmware. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /vdevice/v-scsi@71000002        SCSI: Looking for devices           8200000000000000 CD-ROM   : "QEMU     QEMU CD-ROM 2.5+" Populating /pci@800000020000000                      00 0000 (D) : 1af4 1000    virtio [ net ] No NVRAM common partition, re-initializing... Scanning USB Using default console: /vdevice/vty@71000000   Welcome to Open Firmware   Copyright (c) 2004, 2017 IBM Corporation All rights reserved.   This program and the accompanying materials are made available   under the terms of the BSD License available at   http://www.opensource.org/licenses/bsd-license.php Trying to load:  from: disk ... E3405: No such device Trying to load:  from: /vdevice/v-scsi@71000002/disk@8200000000000000 ... No medium ! E3405: No such device Trying to load:  from: /pci@800000020000000/ethernet@0 ...  Initializing NIC   Reading MAC address from device: 52:54:00:12:34:56   Requesting information via DHCP: done   Using IPv4 address: 10.0.2.15   Requesting file "" via TFTP from 10.0.2.2   Receiving data:  0 KBytes E3010 (net) TFTP access violation E3407: Load failed   Type 'boot' and press return to continue booting the system.   Type 'reset-all' and press return to reboot the system. Ready! 0 > On 01/23/2018 10:34 AM, joserz@linux.vnet.ibm.com wrote: > On Tue, Jan 23, 2018 at 01:05:28AM -0200, joserz@linux.vnet.ibm.com wrote: >> Hello people! >> >> I'm not able to boot any guest that sets a virtio block device like: >> (branch master) >> >> [PPC64] >> qemu-system-ppc64 -cpu POWER8 -nographic -vga none -m 4G -M pseries,accel=kvm,kvm-type=PR -drive file=disk.qcow2,if=virtio > my bad, actually the command line is: > > qemu-system-ppc64 -cpu POWER8 -nographic -vga none -m 4G -M pseries,accel=kvm -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0 -drive file=../disk.qcow2,if=virtio > > and the problem seem to be in virtio-net-pci, not in the block device > > >> QEMU Starting >> Build Date = Dec 18 2017 13:08:00 >> FW Version = git-fa981320a1e0968d >> Press "s" to enter Open Firmware. >> >> Populating /vdevice methods >> Populating /vdevice/vty@71000000 >> Populating /vdevice/nvram@71000001 >> Populating /vdevice/v-scsi@71000002 >> SCSI: Looking for devices >> 8200000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+" >> Populating /pci@800000020000000 >> 00 0000 (D) : 1af4 1000 virtio [ net ] >> Aborted >> >> [x86] >> >> qemu-system-x86_64 -m 4G -enable-kvm -drive file=util.qcow2,if=virtio >> Running QEMU with GTK 2.x is deprecated, and will be removed >> in a future release. Please switch to GTK 3.x instead >> [1] 5282 abort >> >> [Cause] >> >> The commit 4fe6d78b2e introduces the >> >> ... >> kvm_mem_ioeventfd_del(...) { >> ... >> r = kvm_set_ioeventfd_mmio(fd, ... >> if (r < 0) { >> abort(); >> } >> >> + if (e->cleanup) { >> + e->cleanup(e); >> + } >> } >> >> For some reason, not yet clear to me, cleanup() calls the same >> kvm_mem_ioeventfd_del again and again until kvm_set_ioeventfd_mmio >> returns < 0 and abort(). >> >> I was going to send a patch to revert that 'if ()' but I think it could >> cause a regression. What do you guys think? >> >> Thanks, >> >> Jose Ricardo Ziviani >> >> > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 071f4f5..f290f48 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -812,10 +812,6 @@ static void kvm_mem_ioeventfd_del(MemoryListener *listener,      if (r < 0) {          abort();      } - -    if (e->cleanup) { -        e->cleanup(e); -    }  }