From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8XvX-0002pE-Vb for qemu-devel@nongnu.org; Sat, 19 Jul 2014 12:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8XvS-0007IU-29 for qemu-devel@nongnu.org; Sat, 19 Jul 2014 12:56:03 -0400 Received: from mout.web.de ([212.227.15.3]:61550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8XvR-0007IA-Pl for qemu-devel@nongnu.org; Sat, 19 Jul 2014 12:55:58 -0400 Message-ID: <53CAA314.10005@web.de> Date: Sat, 19 Jul 2014 18:55:48 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E0ds4RPIEKvTWkjcFb2A3BFltTChMFBqt" Subject: [Qemu-devel] [PATCH] pci: Don't deliver MSI/MSI-X messages if bus master support is off List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E0ds4RPIEKvTWkjcFb2A3BFltTChMFBqt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable From: Jan Kiszka The spec says (and real HW confirms this) that, if the bus master bit is 0, the device will not generate any PCI accesses. MSI and MSI-X messages fall among these. Signed-off-by: Jan Kiszka --- hw/pci/msi.c | 4 ++++ hw/pci/msix.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index a4a3040..36b651b 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -285,6 +285,10 @@ void msi_notify(PCIDevice *dev, unsigned int vector)= return; } =20 + if (!(pci_get_word(dev->config + PCI_COMMAND) & PCI_COMMAND_MASTER))= { + return; + } + msg =3D msi_get_message(dev, vector); =20 MSI_DEV_PRINTF(dev, diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 5c49bfc..c77ae7d 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -437,6 +437,10 @@ void msix_notify(PCIDevice *dev, unsigned vector) return; } =20 + if (!(pci_get_word(dev->config + PCI_COMMAND) & PCI_COMMAND_MASTER))= { + return; + } + msg =3D msix_get_message(dev, vector); =20 stl_le_phys(&address_space_memory, msg.address, msg.data); --=20 1.8.1.1.298.ge7eed54 --E0ds4RPIEKvTWkjcFb2A3BFltTChMFBqt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlPKoxoACgkQitSsb3rl5xRffgCffUZUuu0diwSZTEprxPM2SnnS tGIAoKxNJ7FIWoJvoqvUa2C8GkgMFt5e =VHot -----END PGP SIGNATURE----- --E0ds4RPIEKvTWkjcFb2A3BFltTChMFBqt--