WARNING - OLD ARCHIVES

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

xen-devel

[Xen-devel] [PATCH 3 of 4] qemu-xen: support PV on HVM MSI remapping

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 4] qemu-xen: support PV on HVM MSI remapping
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Mon, 30 Aug 2010 12:25:03 +0100
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 30 Aug 2010 04:33:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1008301154290.2545@kaball-desktop>
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>
References: <alpine.DEB.2.00.1008301154290.2545@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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