From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeuvE-0004EG-3b for qemu-devel@nongnu.org; Wed, 23 Sep 2015 21:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeuvD-00058N-0y for qemu-devel@nongnu.org; Wed, 23 Sep 2015 21:02:04 -0400 Date: Thu, 24 Sep 2015 10:35:55 +1000 From: David Gibson Message-ID: <20150924003555.GI15944@voom.fritz.box> References: <1442495357-26547-1-git-send-email-david@gibson.dropbear.id.au> <1442495357-26547-10-git-send-email-david@gibson.dropbear.id.au> <1442508890.23936.210.camel@redhat.com> <56028BD0.80504@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PMULwz+zIGJzpDN9" Content-Disposition: inline In-Reply-To: <56028BD0.80504@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 09/10] spapr_iommu: Provide a function to switch a TCE table to allowing VFIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: lvivier@redhat.com, aik@ozlabs.ru, gwshan@linux.vnet.ibm.com, qemu-devel@nongnu.org, Alex Williamson , qemu-ppc@nongnu.org, pbonzini@redhat.com --PMULwz+zIGJzpDN9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 23, 2015 at 01:24:00PM +0200, Thomas Huth wrote: > On 17/09/15 18:54, Alex Williamson wrote: > > On Thu, 2015-09-17 at 23:09 +1000, David Gibson wrote: > >> Because of the way non-VFIO guest IOMMU operations are KVM accelerated= , not > >> all TCE tables (guest IOMMU contexts) can support VFIO devices. Curre= ntly, > >> this is decided at creation time. > >> > >> To support hotplug of VFIO devices, we need to allow a TCE table which > >> previously didn't allow VFIO devices to be switched so that it can. T= his > >> patch adds an spapr_tce_need_vfio() function to do this, by reallocati= ng > >> the table in userspace if necessary. > >> > >> Currently this doesn't allow the KVM acceleration to be re-enabled if = all > >> the VFIO devices are removed. That's an optimization for another time. > >=20 > >=20 > > Same comment as previous patch, spapr_tce_need_userspace_table() (or > > something) makes the code much more self documenting. >=20 > May I also add the using the word "need" in a function name is could be > a little bit confusing here? It's maybe just me, but if I read > ..._need_...() I first think of a function that just checks something > and returns a boolean for yes or no, not of a function that changes > something. > Could you maybe use something like "..._change_to_..." instead? Yeah, I never did much like that name, just couldn't think of a better one. Hmm.. how about spapr_tce_set_need_vfio(), taking a bool parameter. I won't implement the reverse transition just yet, but that gives us an obvious place to put it when/if we do. --=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 --PMULwz+zIGJzpDN9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWA0VrAAoJEGw4ysog2bOSd7cQAJZxD4nPcRVKjrV/buqYQo6x WofRvQiXfggyRahFCIOQRduTeYan6sKxwG3q3n4e33PR0KOLCkHk1UhyvPccAK16 vN1IiJoK/dz4Dfs/8dGSy3Y4qnbFOxRVNkJN6pg1RUCArauw1xLpvki/aOzkD4gW DqgMoaG3rtK3BRh7KAMCHJISSqFVaWLCj31jazsrqc2qn9ItJIrv0O7sLshmRm25 kGdYtCrNlGTvx1u+xosXVNjrRE7t86yjSBYnDqrTQQUSbGLu358Ea97QnUL4z3mo x0MRp6q964PMlqQt2vMLozWUWJvW2vKirQ9WLJLkYnNMdIs0SRKtjE2+HI0txpNp dONW30Kv7CpFCRTGbqhkQ8d6oYqf8gaqhvkYi3OwCunkDfYnsXm7uGYdo426/K37 BQNY3415fISIB+1YWKcKroBK1Tfz0iRM9lS60/CwBLj7xV9BpIR2nURFfhrhpEHq ZRUrQhrUdOZgr1PhVLC1JHlkzYNpucirXPBzlq+dSEf9I4ja/jVQ+bJedjAAE/ct DO6UaoJH2MSScQSXJJhrgtch3E0vJX01mqYqN7dJix+jQ0KB/0yvOf5F8eaqzsAs 7zwSz74i6AZu4uQMVQD2aUMd2wCdX95zz8Mv8v0qvzCa9RDKFqGLT0teu5WsUNFI /rhYodDMjc3zqvJz6+00 =wbJA -----END PGP SIGNATURE----- --PMULwz+zIGJzpDN9--