From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFoDt-0004Ei-AV for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFoDp-0004qD-2f for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:54:04 -0400 Received: from mout.web.de ([212.227.15.3]:57350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFoDo-0004pg-Mh for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:54:00 -0400 References: <1465993312-18119-1-git-send-email-davidkiarie4@gmail.com> <1465993312-18119-2-git-send-email-davidkiarie4@gmail.com> From: Jan Kiszka Message-ID: <576AECD0.8020103@web.de> Date: Wed, 22 Jun 2016 21:53:52 +0200 MIME-Version: 1.0 In-Reply-To: <1465993312-18119-2-git-send-email-davidkiarie4@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VAf06EO4ewjb3ejIiJ1L3A4J563foOd65" Subject: Re: [Qemu-devel] [V12 1/4] hw/pci: Prepare for AMD IOMMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Kiarie , qemu-devel@nongnu.org Cc: marcel@redhat.com, mst@redhat.com, peterx@redhat.com, alex.williamson@redhat.com, valentine.sinitsyn@gmail.com, ehabkost@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VAf06EO4ewjb3ejIiJ1L3A4J563foOd65 From: Jan Kiszka To: David Kiarie , qemu-devel@nongnu.org Cc: marcel@redhat.com, mst@redhat.com, peterx@redhat.com, alex.williamson@redhat.com, valentine.sinitsyn@gmail.com, ehabkost@redhat.com Message-ID: <576AECD0.8020103@web.de> Subject: Re: [V12 1/4] hw/pci: Prepare for AMD IOMMU References: <1465993312-18119-1-git-send-email-davidkiarie4@gmail.com> <1465993312-18119-2-git-send-email-davidkiarie4@gmail.com> In-Reply-To: <1465993312-18119-2-git-send-email-davidkiarie4@gmail.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 2016-06-15 14:21, David Kiarie wrote: > Introduce PCI macros from linux headers for use by AMD IOMMU >=20 > Signed-off-by: David Kiarie > --- > include/hw/pci/pci.h | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > index 4420f47..ac376c5 100644 > --- a/include/hw/pci/pci.h > +++ b/include/hw/pci/pci.h > @@ -12,6 +12,8 @@ > =20 > /* PCI bus */ > =20 > +#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) Minor: should probably come after PCI_DEVFN and before PCI_SLOT to have some logical grouping. > +#define PCI_DEVID(bus, devfn) ((((uint16_t)(bus)) << 8) | (devfn)) That's often called "BDF" (bus-device-function). At least for me clearer than "device ID". > #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x= 07)) > #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) > #define PCI_FUNC(devfn) ((devfn) & 0x07) >=20 Jan --VAf06EO4ewjb3ejIiJ1L3A4J563foOd65 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 iEYEARECAAYFAldq7NEACgkQitSsb3rl5xRXDgCgi1utAmtRYyKhBPllNBksHfan uR8AoJacfNztI8fpW0KrUhkJnjuqhC6w =PCrH -----END PGP SIGNATURE----- --VAf06EO4ewjb3ejIiJ1L3A4J563foOd65--