Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999AbdC0SQd (ORCPT ); Mon, 27 Mar 2017 14:16:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbdC0SQZ (ORCPT ); Mon, 27 Mar 2017 14:16:25 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F266A81254 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F266A81254 Date: Mon, 27 Mar 2017 21:16:12 +0300 From: "Michael S. Tsirkin" To: Christoph Hellwig Cc: Mike Galbraith , Thorsten Leemhuis , virtio-dev@lists.oasis-open.org, Linux Kernel Mailing List , rjones@redhat.com Subject: Re: Random guest crashes since 5c34d002dcc7 ("virtio_pci: use shared interrupts for virtqueues") Message-ID: <20170327211246-mutt-send-email-mst@kernel.org> References: <20170323145622.GA31690@lst.de> <1490605644.14634.50.camel@gmx.de> <20170327170540.GA28715@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170327170540.GA28715@lst.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 27 Mar 2017 18:16:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 32 On Mon, Mar 27, 2017 at 07:05:40PM +0200, Christoph Hellwig wrote: > Hi Mike, > > does the patch below fix that issue for you? > > diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c > index df548a6fb844..fd1b06368b1f 100644 > --- a/drivers/virtio/virtio_pci_common.c > +++ b/drivers/virtio/virtio_pci_common.c > @@ -176,7 +176,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, > if (err < 0) > return err; > > - vp_dev->msix_vectors = nvectors; > + vp_dev->msix_vectors = err; /* number of vectors allocated */ > vp_dev->msix_names = kmalloc_array(nvectors, > sizeof(*vp_dev->msix_names), GFP_KERNEL); > if (!vp_dev->msix_names) Can this sometimes allocate less vectors than min number requested then? I didn't realize. In that case we probably should change if (err < 0) to if (err != nvectors) and similarly for when we try to get 2 vectors. Mike, could you pls send lspci -vv that shows up after boot? -- MST