aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-15 09:49:22 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-15 09:49:22 +0100
commit860ac814053b4665328cd3299365cc90c7b89a5c (patch)
tree331145efb8aa5445bd8e94e3d5777ea660e4712f
parent53638b9235ba267500cae4a7aa3e0153dd67515e (diff)
downloadxen-860ac814053b4665328cd3299365cc90c7b89a5c.tar.gz
xen-860ac814053b4665328cd3299365cc90c7b89a5c.tar.bz2
xen-860ac814053b4665328cd3299365cc90c7b89a5c.zip
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@novell.com> xen-unstable changeset: 21778:421f6c63b220 xen-unstable date: Mon Jul 12 10:43:34 2010 +0100
-rw-r--r--xen/arch/x86/msi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index f6812b2f52..4f16bf23c4 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -623,6 +623,14 @@ static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
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_info *msi, struct msi_desc **desc)
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;
}