From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgJR-0006BK-CK for qemu-devel@nongnu.org; Mon, 12 Jan 2015 09:49:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAgJN-0001Vy-EX for qemu-devel@nongnu.org; Mon, 12 Jan 2015 09:49:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgJN-0001Vq-6A for qemu-devel@nongnu.org; Mon, 12 Jan 2015 09:49:45 -0500 Message-ID: <54B3DEF8.5020400@redhat.com> Date: Mon, 12 Jan 2015 15:49:28 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1419411417-23354-1-git-send-email-liang.z.li@intel.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] [PATCH] xen-pt: Fix PCI devices re-attach failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Li, Liang Z" , "Tian, Kevin" , Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , "mst@redhat.com" , "mtosatti@redhat.com" , "qemu-devel@nongnu.org" , "aliguori@amazon.com" , "Zhang, Yang Z" , "Hu, Robert" , "rth@twiddle.net" On 12/01/2015 14:35, Li, Liang Z wrote: > > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index c1bf357..f2893b2 100644 > --- a/hw/xen/xen_pt.c > +++ b/hw/xen/xen_pt.c > @@ -736,7 +736,7 @@ static int xen_pt_initfn(PCIDevice *d) > } > > out: > - memory_listener_register(&s->memory_listener, &address_space_memory); > + memory_listener_register(&s->memory_listener, > + &s->dev.bus_master_as); > memory_listener_register(&s->io_listener, &address_space_io); > XEN_PT_LOG(d, > "Real physical device %02x:%02x.%d registered successfully!\n", > > By further debugging, I found when using 'address_space_memory', 'xen_pt_region_del' > won't be called when the memory region's name is not ' xen-pci-pt-*', when using > ' s->dev.bus_master_as ', there is no such issue. > > I think use the device related address space here is more reasonable, but I am not sure. > Could you give some suggestion? Yes, this patch makes sense. The listener will be called every time the command register is written. Paolo