qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] MSI-X bug with ivshmem since msix_reset moved to PCI
@ 2012-08-23 23:13 Cam Macdonell
  2012-08-24  5:59 ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Cam Macdonell @ 2012-08-23 23:13 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel@nongnu.org Developers, Michael S. Tsirkin

Hi Jan,

I've bisected a bug in which MSI interrupts are not being delivered to
the following patch, where msix_reset was moved in tot he PCI core.

commit cbd2d4342b3d42ab33baa99f5b7a23491b5692f2
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Tue May 15 20:09:56 2012 -0300

    msi: Invoke msi/msix_reset from PCI core

    There is no point in pushing this burden to the devices, they tend to
    forget to call them (like intel-hda, ahci, xhci did). Instead, reset
    functions are now called from pci_device_reset. They do nothing if
    MSI/MSI-X is not in use.

I've been debugging and it seems that when msix_notify() is triggered
the second test in the "if" fails

/* Send an MSI-X message */
void msix_notify(PCIDevice *dev, unsigned vector)
{
    MSIMessage msg;

    if (vector >= dev->msix_entries_nr || !dev->msix_entry_used[vector])
        return;

   …
}

here is some MSI-X debugging statements

msix_init
IVSHMEM: msix initialized (1 vectors)
IVSHMEM: using vector 0
IVSHMEM: ivshmem_reset
IVSHMEM: using vector 0
msix_reset
msix_free_irq_entries 0x7fd52d1cea20

msix_free_irq_entries() sets dev->msix_entries_nr to 0, so I think it
may be the cause.

Shouldn't ivshmem's reset (which reenables the vectors) be triggered
by the msix_reset?

Thanks,
Cam

p.s. And apologies, I should've caught this bug closer to that patch
being merged.

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

end of thread, other threads:[~2012-08-24  9:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 23:13 [Qemu-devel] MSI-X bug with ivshmem since msix_reset moved to PCI Cam Macdonell
2012-08-24  5:59 ` Jan Kiszka
2012-08-24  8:11   ` Michael S. Tsirkin
2012-08-24  8:15     ` Jan Kiszka
2012-08-24  8:36       ` Michael S. Tsirkin
2012-08-24  8:39         ` Jan Kiszka
2012-08-24  9:20           ` 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).