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

[Xen-changelog] [xen-4.0-testing] x86: prevent simultaneous use of MSI and MSI-X



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1279183762 -3600
# Node ID 61f09a05b46352fc14305979ea200f3874d6014b
# Parent  3bb6759b167cbcb0cdf610d14fdaa17df4c17c73
x86: prevent simultaneous use of MSI and MSI-X

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>
xen-unstable changeset:   21778:421f6c63b220
xen-unstable date:        Mon Jul 12 10:43:34 2010 +0100
---
 xen/arch/x86/msi.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

diff -r 3bb6759b167c -r 61f09a05b463 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c        Thu Jul 15 09:49:00 2010 +0100
+++ b/xen/arch/x86/msi.c        Thu Jul 15 09:49:22 2010 +0100
@@ -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;
 }

_______________________________________________
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®.