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] [PATCH] Fixfor xen bug 1306: Dom0 hangs when destoryingone g

To: "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fixfor xen bug 1306: Dom0 hangs when destoryingone guest with MSI NIC assigned
From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Date: Thu, 31 Jul 2008 14:03:52 +0800
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, "Li, Xin B" <xin.b.li@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, "Li, Susie" <susie.li@xxxxxxxxx>
Delivery-date: Wed, 30 Jul 2008 23:05:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <823A93EED437D048963A3697DB0E35DE01950C8A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <823A93EED437D048963A3697DB0E35DE01950C8A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjxS8fKdxEQ0abxQSSqea3LwyfUHQBhqvAg
Thread-topic: [PATCH] Fixfor xen bug 1306: Dom0 hangs when destoryingone guest with MSI NIC assigned
Hi, Keir,

Since I have got no response from Espen, I try to fix the bug myself. Please 
see the attached patch.
Description:
This patch will fix bug 1306. The reason is explained in my former mail. This 
patch also removes hard tabs in msi.c.

Signed-off-by: Shan Haitao <Haitao.shan@xxxxxxxxx>

Best Regards
Shan Haitao

-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Shan, Haitao
Sent: 2008年7月29日 15:22
To: Espen Skoglund; Keir Fraser
Cc: Jiang, Yunhong; xen-devel@xxxxxxxxxxxxxxxxxxx; Li, Xin B; Li, Susie
Subject: [Xen-devel] Root cause of xen bug 1306: Dom0 hangs when destoryingone 
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

Attachment: msi_fix_lock.patch
Description: msi_fix_lock.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>