PT_LOG("guest enabling MSI, disable MSI-INTx translation\n");
pt_disable_msi_translate(ptdev);
}
- else
+ /* Init physical one */
+ PT_LOG("setup msi for dev %x\n", pd->devfn);
+ if (pt_msi_setup(ptdev))
{
- /* Init physical one */
- PT_LOG("setup msi for dev %x\n", pd->devfn);
- if (pt_msi_setup(ptdev))
- {
- /* We do not broadcast the error to the framework code, so
- * that MSI errors are contained in MSI emulation code and
- * QEMU can go on running.
- * Guest MSI would be actually not working.
- */
- *value &= ~PCI_MSI_FLAGS_ENABLE;
- PT_LOG("Warning: Can not map MSI for dev %x\n", pd->devfn);
- return 0;
- }
+ /* We do not broadcast the error to the framework code, so
+ * that MSI errors are contained in MSI emulation code and
+ * QEMU can go on running.
+ * Guest MSI would be actually not working.
+ */
+ *value &= ~PCI_MSI_FLAGS_ENABLE;
+ PT_LOG("Warning: Can not map MSI for dev %x\n", pd->devfn);
+ return 0;
}
if (pt_msi_update(ptdev))
{
uint8_t e_device = 0;
uint8_t e_intx = 0;
- /* MSI_ENABLE bit should be disabed until the new handler is set */
- msi_set_enable(dev, 0);
-
- e_device = PCI_SLOT(dev->dev.devfn);
- e_intx = pci_intx(dev);
-
- if (xc_domain_unbind_pt_irq(xc_handle, domid, dev->msi->pirq,
- PT_IRQ_TYPE_MSI_TRANSLATE, 0,
- e_device, e_intx, 0))
- PT_LOG("Error: Unbinding pt irq for MSI-INTx failed!\n");
+ pt_msi_disable(dev);
+ dev->msi->flags |= MSI_FLAG_UNINIT;
if (dev->machine_irq)
{
0, e_device, e_intx))
PT_LOG("Error: Rebinding of interrupt failed!\n");
}
-
- dev->msi_trans_en = 0;
}
/* MSI-X virtulization functions */