qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] migrating guest with msi-x interrupts
@ 2010-05-25 22:09 Cam Macdonell
  2010-05-26 14:02 ` [Qemu-devel] " Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Cam Macdonell @ 2010-05-25 22:09 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers, Michael S. Tsirkin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: migrating guest with msi-x interrupts
  2010-05-25 22:09 [Qemu-devel] migrating guest with msi-x interrupts Cam Macdonell
@ 2010-05-26 14:02 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2010-05-26 14:02 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-26 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 22:09 [Qemu-devel] migrating guest with msi-x interrupts Cam Macdonell
2010-05-26 14:02 ` [Qemu-devel] " Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).