This patch fixes double unbinding of INTx interrupt when PCI device is
hot-removed.
Thanks,
--
Yuji Shimada
Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
diff --git a/hw/pass-through.c b/hw/pass-through.c
index a498f62..faa701c 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -1858,6 +1858,20 @@ static void pt_reset_interrupt_and_io_mapping(struct
pt_dev *ptdev)
PCIDevice *d = &ptdev->dev;
PCIIORegion *r;
int i = 0;
+ uint8_t e_device = 0;
+ uint8_t e_intx = 0;
+
+ /* unbind INTx */
+ e_device = (ptdev->dev.devfn >> 3) & 0x1f;
+ /* fix virtual interrupt pin to INTA# */
+ e_intx = 0;
+
+ if (ptdev->msi_trans_en == 0 && ptdev->machine_irq)
+ {
+ if (xc_domain_unbind_pt_irq(xc_handle, domid, ptdev->machine_irq,
+ PT_IRQ_TYPE_PCI, 0, e_device, e_intx, 0))
+ PT_LOG("Error: Unbinding of interrupt failed!\n");
+ }
/* disable MSI/MSI-X and MSI-INTx translation */
if (ptdev->msi)
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 887f0a2..d28038a 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -187,13 +187,6 @@ void pt_msi_disable(struct pt_dev *dev)
goto out;
}
}
- /* unbind INTx */
- if (dev->msi_trans_cap && !dev->msi_trans_en)
- {
- if (xc_domain_unbind_pt_irq(xc_handle, domid, dev->machine_irq,
- PT_IRQ_TYPE_PCI, 0, e_device, e_intx, 0))
- PT_LOG("Error: Unbinding of interrupt failed!\n");
- }
out:
/* clear msi info */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|