aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/msi.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-12 10:43:34 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-12 10:43:34 +0100
commitc507b364854c06cc818b62e24ac9df08b92be9ba (patch)
treef04a4e647cbfd8a4d8383a5dd96819b2144b3997 /xen/arch/x86/msi.c
parent355938432e87ba88f380c2a119f486b00adebf05 (diff)
downloadxen-c507b364854c06cc818b62e24ac9df08b92be9ba.tar.gz
xen-c507b364854c06cc818b62e24ac9df08b92be9ba.tar.bz2
xen-c507b364854c06cc818b62e24ac9df08b92be9ba.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>
Diffstat (limited to 'xen/arch/x86/msi.c')
-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;
}