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/
Home Products Support Community News


[Xen-devel] [PATCH]vtd: Fix for irq bind failure after PCI attaching 32

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]vtd: Fix for irq bind failure after PCI attaching 32 times
From: "Zhang, Fengzhe" <fengzhe.zhang@xxxxxxxxx>
Date: Wed, 26 Jan 2011 16:02:27 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Zhang, Fengzhe" <fengzhe.zhang@xxxxxxxxx>
Delivery-date: Wed, 26 Jan 2011 00:05:22 -0800
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: Acu9L199Wlrtz9EgQeylFfmFTFvqLA==
Thread-topic: [PATCH]vtd: Fix for irq bind failure after PCI attaching 32 times
vtd: Fix for irq bind failure after PCI attaching 32 times

Originally when detaching a PCI device, pirq_to_emuirq and pirq_to_irq are 
freed via hypercall do_physdev_op. Now in function pt_irq_destroy_bind_vtd, 
duplicated logic is added to free pirq_to_emuirq, but not pirq_to_irq. This 
causes do_physdev_op fail to free both emuirq and irq. After attaching a PCI 
device for 32 times, irq resources run out. This patch removes the redundant 

Signed-off-by: Fengzhe Zhang <fengzhe.zhang@xxxxxxxxx>

diff -r 003acf02d416 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c      Thu Jan 20 17:04:06 2011 +0000
+++ b/xen/drivers/passthrough/io.c      Wed Jan 26 23:05:33 2011 +0800
@@ -375,7 +375,6 @@
             hvm_irq_dpci->mirq[machine_gsi].dom   = NULL;
             hvm_irq_dpci->mirq[machine_gsi].flags = 0;
             clear_bit(machine_gsi, hvm_irq_dpci->mapping);
-            unmap_domain_pirq_emuirq(d, machine_gsi);

Attachment: irq_bind_failure_after_pci-attach_32_times_fix.patch
Description: irq_bind_failure_after_pci-attach_32_times_fix.patch

Xen-devel mailing list