qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] xen-pt: Fix bug cause PCI devices re-attach fai


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] xen-pt: Fix bug cause PCI devices re-attach failed
Date: Mon, 13 Apr 2015 16:28:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 13/04/2015 16:12, Liang Li wrote:
>     2. Do the attach and detach operation with a time interval. eg. 10s.
> 
>     The error message will not  disappear if retry, in this case, it's
>     a bug.
> 
> In the 'xen_pt_region_add' and 'xen_pt_region_del', we should only care
> about the 'xen-pci-pt-*' memory region, this can avoid the region's
> reference count is not equal with the dereference count when the
> device is detached and prevent the device's related QemuOpts object from
> being released properly, and then trigger the bug when the device is
> re-attached.

This doesn't explain _which_ region is causing the bug and how.

Assuming this is the right fix, should you instead move the
memory_region_ref/unref pair from xen_pt_region_add/del after this
conditional:

    if (bar == -1 && (!s->msix || &s->msix->mmio != mr)) {
        return;
    }

in xen_pt_region_update?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]