From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RX99w-00059u-In for qemu-devel@nongnu.org; Sun, 04 Dec 2011 05:19:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RX99v-0000Wp-Lh for qemu-devel@nongnu.org; Sun, 04 Dec 2011 05:19:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RX99v-0000WH-CY for qemu-devel@nongnu.org; Sun, 04 Dec 2011 05:18:59 -0500 Date: Sun, 4 Dec 2011 12:20:37 +0200 From: "Michael S. Tsirkin" Message-ID: <20111204102036.GB15464@redhat.com> References: <27ef57671106d9214757df8a1d4cc28287dae07c.1321893802.git.mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH for v1.0 1/3] msix: track function masked in pci device state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cam Macdonell Cc: Blue Swirl , Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf On Fri, Dec 02, 2011 at 04:34:21PM -0700, Cam Macdonell wrote: > Based on a git bisect, this patch breaks msi-x interrupt delivery in > the ivshmem device. I think the following should fix it. Compiled-only - could you pls check? If yes let's apply to the stable branch. --> ivshmem: add missing msix calls ivshmem used msix but didn't call it on either reset or config write paths. This used to partically work since guests don't use all of msi-x configuration fields, and reset is rarely used, but the patch 'msix: track function masked in pci device state' broke that. Fix by adding appropriate calls. Signed-off-by: Michael S. Tsirkin -- diff --git a/hw/ivshmem.c b/hw/ivshmem.c index 242fbea..3680c0f 100644 --- a/hw/ivshmem.c +++ b/hw/ivshmem.c @@ -505,6 +505,7 @@ static void ivshmem_reset(DeviceState *d) IVShmemState *s = DO_UPCAST(IVShmemState, dev.qdev, d); s->intrstatus = 0; + msix_reset(&s->dev); return; } @@ -610,6 +611,13 @@ static int ivshmem_load(QEMUFile* f, void *opaque, int version_id) return 0; } +static void ivshmem_write_config(PCIDevice *pci_dev, uint32_t address, + uint32_t val, int len) +{ + pci_default_write_config(pci_dev, address, val, len); + msix_write_config(pci_dev, address, val, len); +} + static int pci_ivshmem_init(PCIDevice *dev) { IVShmemState *s = DO_UPCAST(IVShmemState, dev, dev); @@ -734,6 +742,8 @@ static int pci_ivshmem_init(PCIDevice *dev) } + s->dev.config_write = ivshmem_write_config; + return 0; }