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 1/3] x86: prevent simultaneous use of MSI and MSI-X

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/3] x86: prevent simultaneous use of MSI and MSI-X
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 12 Jul 2010 10:35:04 +0100
Delivery-date: Mon, 12 Jul 2010 02:35:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This matches similar checks done in Linux, since no good can come from
a domain trying to enable both MSI and MSI-X on the same device at the
same time.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2010-06-15.orig/xen/arch/x86/msi.c  2010-07-09 14:13:16.000000000 +0200
+++ 2010-06-15/xen/arch/x86/msi.c       2010-07-09 14:14:49.000000000 +0200
@@ -623,6 +623,14 @@ static int __pci_enable_msi(struct msi_i
         return 0;
     }
 
+    if ( find_msi_entry(pdev, -1, PCI_CAP_ID_MSIX) )
+    {
+        dprintk(XENLOG_WARNING, "MSI-X is already in use on "
+                "device %02x:%02x.%01x\n", msi->bus,
+                PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
+        return 0;
+    }
+
     status = msi_capability_init(pdev, msi->irq, desc);
     return status;
 }
@@ -689,6 +697,14 @@ static int __pci_enable_msix(struct msi_
         return 0;
     }
 
+    if ( find_msi_entry(pdev, -1, PCI_CAP_ID_MSI) )
+    {
+        dprintk(XENLOG_WARNING, "MSI is already in use on "
+                "device %02x:%02x.%01x\n", msi->bus,
+                PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
+        return 0;
+    }
+
     status = msix_capability_init(pdev, msi, desc);
     return status;
 }



Attachment: x86-prevent-msi-and-msix.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/3] x86: prevent simultaneous use of MSI and MSI-X, Jan Beulich <=