WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Root cause of xen bug 1306: Dom0 hangs when destorying one g

To: "Espen Skoglund" <espen.skoglund@xxxxxxxxxxxxx>, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] Root cause of xen bug 1306: Dom0 hangs when destorying one guest with MSI NIC assigned
From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Date: Tue, 29 Jul 2008 15:21:55 +0800
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, "Li, Xin B" <xin.b.li@xxxxxxxxx>, "Li, Susie" <susie.li@xxxxxxxxx>
Delivery-date: Tue, 29 Jul 2008 00:22:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjxS8fKdxEQ0abxQSSqea3LwyfUHQ==
Thread-topic: 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

<Prev in Thread] Current Thread [Next in Thread>