From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6tcg-00060R-VL for qemu-devel@nongnu.org; Mon, 22 Jun 2015 00:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6tcf-0004E8-Lz for qemu-devel@nongnu.org; Mon, 22 Jun 2015 00:46:18 -0400 Date: Mon, 22 Jun 2015 14:41:06 +1000 From: David Gibson Message-ID: <20150622044106.GS13352@voom.redhat.com> References: <1434627456-13745-1-git-send-email-aik@ozlabs.ru> <1434627456-13745-11-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pFwAERqMlXzMQ5I7" Content-Disposition: inline In-Reply-To: <1434627456-13745-11-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu v8 10/14] spapr_vfio_pci: Remove redundant spapr-pci-vfio-host-bridge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Gavin Shan , Alexander Graf --pFwAERqMlXzMQ5I7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 18, 2015 at 09:37:32PM +1000, Alexey Kardashevskiy wrote: > sPAPRTCETable is handling 2 TCE tables already: >=20 > 1) guest view of the TCE table - emulated devices use only this table; >=20 > 2) hardware IOMMU table - VFIO PCI devices use it for actual work but > it does not replace 1) and it is not visible to the guest. > The initialization of this table is driven by vfio-pci device, > DMA map/unmap requests are handled via MemoryListener so there is very > little to do in spapr-pci-vfio-host-bridge. >=20 > This moves VFIO bits to the generic spapr-pci-host-bridge which allows > putting emulated and VFIO devices on the same PHB. It is still possible > to create multiple PHBs and avoid sharing PHB resouces for emulated and > VFIO devices. >=20 > If there is no VFIO-PCI device attaches, no special ioctls will be called. > If there are some VFIO-PCI devices attached, PHB may refuse to attach > another VFIO-PCI device if a VFIO container on the host kernel side > does not support container sharing. >=20 > This changes spapr-pci-host-bridge to support properties of > spapr-pci-vfio-host-bridge. This makes spapr-pci-vfio-host-bridge type > equal to spapr-pci-host-bridge except it has an additional "iommu" > property for backward compatibility reasons. >=20 > This moves PCI device lookup from spapr_phb_vfio_eeh_set_option() to > rtas_ibm_set_eeh_option() as we need to know if the device is "vfio-pci" > and decide whether to call spapr_phb_vfio_eeh_set_option() or not. >=20 > Signed-off-by: Alexey Kardashevskiy > Reviewed-by: David Gibson I like the idea of merging the two PHB classes. But.. what if you hotplug a VFIO device on to a PHB that previously didn't have one. I don't see anything here that will update has_vfio and copy the existing TCE tables into VFIO. [snip] > @@ -1185,6 +1161,11 @@ static void spapr_phb_realize(DeviceState *dev, Er= ror **errp) > uint64_t msi_window_size =3D 4096; > sPAPRTCETable *tcet; > =20 > + if ((sphb->iommugroupid !=3D -1) && > + object_dynamic_cast(OBJECT(sphb), TYPE_SPAPR_PCI_VFIO_HOST_BRIDG= E)) { > + error_report("Warning: iommugroupid shall not be used"); That's a rather cryptic error message. How about "Warning: iommugroupid is deprecated and will be ignored" --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --pFwAERqMlXzMQ5I7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVh5HiAAoJEGw4ysog2bOS6gYQAKN+jrFPAx8otEixhciQ+pLl WSH9QJcg3X+rB0SwRA0JdyvQVRrqhvO7yXOHSqvjo2jAqdgZI45H6qUHvTtSRvT6 rAO99wBgiBXNAQTkcLDWg8Zh8Fz57wDTCqyiiZxk6/mwuiLrXZNBhnHGq9ZjYGrw MkWvhnnMqCWz02XJas7GajoFL0vS+t8bz5OhGdLbeNTM3r/UmXGK9ZmACVqh1iS3 6NTZCOY61k2HjuEDcWyfw10N2AoIUgqGYy1aiSHgHgV0/2i8ZWf1PeMXquny1Ct1 N3DiuXA0NkeOSetNIPBz9HnxuvQFfAH9whxappgaowLNMIxMCk6+M+iS7KXr6jLs JAwUiXWd5LG+X/YsOxLZmWZuzniIFXb/ZPQlLm/u6nwLk/5WlXAmlhvUbWYf6JIj VtMsQODv7AtrCgrGAfuusQe45B3+NfHO+sG084OtjA8rzH2GRYA8YBvNQhc7iZpb QY+lMJDt+OuKEuN3hhbQyDOMObmI3Oa1IFWouQYEz8CBOr/0BWaMJmRorEQD1lM7 /s+AddpeNnnh8j5UdIhNRiSKVokwWIIyxBa/hAu3tiD9d8AKkWO4HoL6Vdtg4I65 3J4pVSDYjLQnuheu1jUsqAZOa4zM0LRH9WyklwXQMODf6EL0k+7kvEUcvb3qe25u OMmd8/MrhxsSZPrS8G7P =ppc8 -----END PGP SIGNATURE----- --pFwAERqMlXzMQ5I7--