[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Root cause of xen bug 1306: Dom0 hangs when destorying one guest with MSI NIC assigned



Hi, Espen,

Some recent changsets break the MSI function. Please see my comments embedded 
in the following code snippet.
Another problem is the following function is invoked by pci_release_devices, 
which is executed before iommu_domain_destroy. However, the following function 
must be executed after unbinding all guest pirqs. The unbinding code is located 
in iommu_domain_destroy.

I am not familiar with recent IOMMU code. Could you please have a look?

static void msi_free_vectors(struct pci_dev* dev)
{
    struct msi_desc *entry, *tmp;
    irq_desc_t *desc;
    unsigned long flags;

retry:
    list_for_each_entry_safe( entry, tmp, &dev->msi_list, list )
    {
        desc = &irq_desc[entry->vector];

    local_irq_save(flags);
    if ( !spin_trylock(&desc->lock) )
    {
        local_irq_restore(flags);
        goto retry;
    }

        spin_lock_irqsave(&desc->lock, flags);
-----→the above line should be removed, otherwise dead lock will occur by 
acquiring a lock already acquired.
        if ( desc->handler == &pci_msi_type )
        {
            /* MSI is not shared, so should be released already */
            BUG_ON(desc->status & IRQ_GUEST);
            desc->handler = &no_irq_type;
        }

        msi_free_vector(entry->vector);
        spin_unlock_irqrestore(&desc->lock, flags);
    }
}

Best Regards
Shan Haitao

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.