If the guest enables an MSI passing 0 as vector number, then read the
address and use it as pirq number for the following mapping request to
Xen.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index b59b4fa..f0fb3e3 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -65,6 +65,7 @@ static void msix_set_enable(struct pt_dev *dev, int en)
int pt_msi_setup(struct pt_dev *dev)
{
int pirq = -1;
+ uint8_t gvec = 0;
if ( !(dev->msi->flags & MSI_FLAG_UNINIT) )
{
@@ -72,6 +73,15 @@ int pt_msi_setup(struct pt_dev *dev)
return -1;
}
+ gvec = dev->msi->data & 0xFF;
+ if (!gvec) {
+ /* if gvec is 0, the guest is asking for a particular pirq that
+ * is passed as dest_id */
+ pirq = (dev->msi->addr_hi & 0xffffff00) |
+ ((dev->msi->addr_lo >> MSI_TARGET_CPU_SHIFT) & 0xff);
+ PT_LOG("pt_msi_setup requested pirq = %d\n", pirq);
+ }
+
if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
PCI_DEVFN(dev->pci_dev->dev,
ev->pci_dev->func),
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|