[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen-unstable] passthrough: support PV on HVM MSI remapping



commit 1c0663380cec9ae6d01e189dbe963f76f92fd5a0
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Fri Nov 19 18:50:07 2010 +0000

    passthrough: support PV on HVM MSI remapping
    
    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>
---
 hw/pt-msi.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

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,
                                            dev->pci_dev->func),
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.