From: "Jan Beulich" Subject: map_domain_emuirq_pirq() imbalance with unmap_domain_pirq_emuirq()? Date: Tue, 13 Dec 2011 13:54:33 +0000 Message-ID: <4EE7672902000078000674D4@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi Stefano, in your patch to introduce pIRQ interrupt remapping for HVM guests, you have physdev_map_pirq() call unmap_domain_pirq_emuirq() unconditionally in the HVM case, yet physdev_hvm_map_pirq() call map_domain_emuirq_pirq() only if no machine_gsi was found. I'm suspecting this to be the reason for pass-through device hot unplug resource leaks (leading eventually to hot plug failure on repeated attempts), as in this case it is my understanding that unmap_domain_pirq_emuirq() can only be expected to fail (for there not being an established mapping), leading to physdev_unmap_pirq() bailing out early. As it's not immediately clear whether using the same lookup approach that physdev_hvm_map_pirq() uses would be valid in the unmap path, I'm hoping for your advice how to address this problem. Is there perhaps a map_domain_emuirq_pirq(..., IRQ_PT) call missing? Besides that, in 23806:4226ea1785b5 you move a call to map_domain_emuirq_pirq() from xen/arch/x86/physdev.c to xen/common/event_channel.c, but neither before nor after the patch the function's return value gets checked, yet the function has various ways to fail. Is failure here really benign? Jan