From: "Jan Beulich" Subject: [PATCH 1/3] x86: prevent simultaneous use of MSI and MSI-X Date: Mon, 12 Jul 2010 10:35:04 +0100 Message-ID: <4C3AFDE8020000780000AB4F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part270A5CD8.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part270A5CD8.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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; } =20 + 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 =3D msi_capability_init(pdev, msi->irq, desc); return status; } @@ -689,6 +697,14 @@ static int __pci_enable_msix(struct msi_ return 0; } =20 + 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 =3D msix_capability_init(pdev, msi, desc); return status; } --=__Part270A5CD8.0__= Content-Type: text/plain; name="x86-prevent-msi-and-msix.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-prevent-msi-and-msix.patch" This matches similar checks done in Linux, since no good can come from=0Aa = domain trying to enable both MSI and MSI-X on the same device at the=0Asame= time.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = 2010-06-15.orig/xen/arch/x86/msi.c 2010-07-09 14:13:16.000000000 = +0200=0A+++ 2010-06-15/xen/arch/x86/msi.c 2010-07-09 14:14:49.0000000= 00 +0200=0A@@ -623,6 +623,14 @@ static int __pci_enable_msi(struct = msi_i=0A return 0;=0A }=0A =0A+ if ( find_msi_entry(pdev, = -1, PCI_CAP_ID_MSIX) )=0A+ {=0A+ dprintk(XENLOG_WARNING, "MSI-X = is already in use on "=0A+ "device %02x:%02x.%01x\n", = msi->bus,=0A+ PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));= =0A+ return 0;=0A+ }=0A+=0A status =3D msi_capability_init(pd= ev, msi->irq, desc);=0A return status;=0A }=0A@@ -689,6 +697,14 @@ = static int __pci_enable_msix(struct msi_=0A return 0;=0A }=0A = =0A+ if ( find_msi_entry(pdev, -1, PCI_CAP_ID_MSI) )=0A+ {=0A+ = dprintk(XENLOG_WARNING, "MSI is already in use on "=0A+ = "device %02x:%02x.%01x\n", msi->bus,=0A+ PCI_SLOT(msi->devfn= ), PCI_FUNC(msi->devfn));=0A+ return 0;=0A+ }=0A+=0A status = =3D msix_capability_init(pdev, msi, desc);=0A return status;=0A }=0A --=__Part270A5CD8.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part270A5CD8.0__=--