Jan Beulich
2010-Jul-12 09:35 UTC
[Xen-devel] [PATCH 1/3] 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> --- 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; } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel