From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45440 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHHNQ-0003Mk-OJ for qemu-devel@nongnu.org; Wed, 26 May 2010 10:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHHGM-0003ZX-Kb for qemu-devel@nongnu.org; Wed, 26 May 2010 10:07:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51472) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHHGM-0003ZF-Dl for qemu-devel@nongnu.org; Wed, 26 May 2010 10:07:14 -0400 Date: Wed, 26 May 2010 17:02:47 +0300 From: "Michael S. Tsirkin" Message-ID: <20100526140247.GA32021@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: migrating guest with msi-x interrupts List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cam Macdonell Cc: "qemu-devel@nongnu.org Developers" On Tue, May 25, 2010 at 04:09:13PM -0600, Cam Macdonell wrote: > Hi, > > I'm trying to migrate a guest device with MSI-X interrupts. However, > the interrupts are not injected into the guest. I've added some > tracing to msix.c and it seems that the MSI-X vectors are masked when > the guest is resumed (I'm testing with static migration). > > In particular, in msix.c, msix_is_masked(...) is returning true when > the guest resumes which causes msix_set_pending() to be called instead > of msix_set_irq(). > > /* Send an MSI-X message */ > void msix_notify(PCIDevice *dev, unsigned vector) > { > uint8_t *table_entry = dev->msix_table_page + vector * MSIX_ENTRY_SIZE; > uint64_t address; > uint32_t data; > > if (vector >= dev->msix_entries_nr || !dev->msix_entry_used[vector]) > return; > > if (msix_is_masked(dev, vector)) { > msix_set_pending(dev, vector); > return; > } > > ... > > Does migrating a guest device that uses MSI-X require > msix_load()/save() to be called explicity in a pre/post_save/load > function? > > Any pointers or comments would be helpful, > Cam Yes. Look at how virtio does this. Incidentially, I think reusing virtio for configuration would save effort, and have other advantages such as making it possible to support non-pci guests. -- MST