From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1saG-0002Ts-Uy for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:34:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1sa9-0000n5-FB for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:34:32 -0400 Received: from mout.web.de ([212.227.17.12]:55192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1sa9-0000ka-4n for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:34:25 -0400 Message-ID: <53B26475.9030809@web.de> Date: Tue, 01 Jul 2014 09:34:13 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DoXe8nFfctCrkRcmElbM1FKnNFfar1fpo" Subject: Re: [Qemu-devel] Why devfn will be -1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Le Tan Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DoXe8nFfctCrkRcmElbM1FKnNFfar1fpo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Le, On 2014-07-01 04:34, Le Tan wrote: > Hi Jan, > I use pci_setup_iommu() to setup a PCIIOMMUFunc for the q35 pci bus. > In the iommu_fn, I print out the devfn parameter and find out that it > sometimes will be -1. So what does it mean? > The detail code is here: >=20 > In mch_init() function, I write like this: > PCIBus *pci_bus =3D PCI_BUS(qdev_get_parent_bus(DEVICE(mch))); > pci_setup_iommu(pci_bus, q35_host_dma_iommu, mch->iommu); >=20 > And in q35_host_dma_iommu(PCIBus *bus, void *opaque, int devfn), I > print out the devfn parameter, sometimes it will be -1. Hmm, I have no idea about the reason and would suggest to set a conditional breakpoint on this function, then print the backtrace to see where this comes from and analyze the device structure from where that -1 was most probably taken. Jan --DoXe8nFfctCrkRcmElbM1FKnNFfar1fpo 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/ iEYEARECAAYFAlOyZHgACgkQitSsb3rl5xTg3ACgtyIzwYDmU3Ehkrrlso8Rvk/j dnMAniuX8N8aTqmP3gdCab3UZ4CWbM2+ =ycEW -----END PGP SIGNATURE----- --DoXe8nFfctCrkRcmElbM1FKnNFfar1fpo--