From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD4IR-0007Q9-L6 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 02:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD4IL-0004rr-PQ for qemu-devel@nongnu.org; Wed, 15 Jun 2016 02:27:26 -0400 Date: Wed, 15 Jun 2016 16:15:15 +1000 From: David Gibson Message-ID: <20160615061515.GH21472@voom.fritz.box> References: <1464771463-37214-1-git-send-email-aik@ozlabs.ru> <201606010902.u518wwmb029353@mx0a-001b2d01.pphosted.com> <20160602033558.GK15455@voom.fritz.box> <3901766f-6adc-b04d-f498-00bbbd0a3724@redhat.com> <20160608060006.GY9226@voom.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AzNpbZlgThVzWita" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH qemu v17 06/12] memory: Add reporting of supported page sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Paolo Bonzini , Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf --AzNpbZlgThVzWita Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 08, 2016 at 04:05:48PM +1000, Alexey Kardashevskiy wrote: > On 08/06/16 16:00, David Gibson wrote: > > On Mon, Jun 06, 2016 at 03:31:04PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 02/06/2016 05:35, David Gibson wrote: > >>> On Wed, Jun 01, 2016 at 06:57:37PM +1000, Alexey Kardashevskiy wrote: > >>>>> Every IOMMU has some granularity which MemoryRegionIOMMUOps::transl= ate > >>>>> uses when translating, however this information is not available ou= tside > >>>>> the translate context for various checks. > >>>>> > >>>>> This adds a get_page_sizes callback to MemoryRegionIOMMUOps and > >>>>> a wrapper for it so IOMMU users (such as VFIO) can know the actual > >>>>> page size(s) used by an IOMMU. > >>>>> > >>>>> As IOMMU MR represents a guest IOMMU, this uses TARGET_PAGE_SIZE > >>>>> as fallback. > >>>>> > >>>>> This removes vfio_container_granularity() and uses new helper in > >>>>> memory_region_iommu_replay() when replaying IOMMU mappings on added > >>>>> IOMMU memory region. > >>>>> > >>>>> Signed-off-by: Alexey Kardashevskiy > >>>>> Reviewed-by: David Gibson > >>> Paolo, > >>> > >>> Looks like you were left off the CC for this one. > >>> > >>> I think this is ready to go - do you want to merge, comment or ack and > >>> we'll take it either through my tree or Alex's? > >> > >> It's okay for you to merge, but the callback should be called > >> "get_page_size" or "get_replay_granularity". The plural is weird. > >=20 > > Hm, no, it really could return multiple page sizes if the logical > > (guest side) IOMMU supports them. >=20 > It could but it does not now and I cannot see it coming in near future so= I > am really confused now about the naming and what the callback should retu= rn > - one page size or a mask. What should it be now? Eh, make it a single page size for now. We can extend it to a mask if we ever need it. But for clarity, best to call it 'get_min_page_size' or 'get_granularity'. > > That might be useful at some point > > in the future. For now, it's sufficient for the replay to use the > > smallest pagesize. --=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 --AzNpbZlgThVzWita Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXYPJzAAoJEGw4ysog2bOSsl0QAI/PY5QhHXpHfd9NnrX5CkYe RRoeGwoxmbXIDzRfvB/ClSL3/Gm/qhAVqZsG79OsawxZHGl7lkG5G4skTyNmki+G j4uKUShs7qNObNrvk6RAF6n1Mj4u3SUBfxZbVlGHr4pcoptw4mFz7wXItEGCISHm 4zwwCuduCMYGJzyxhsJPy0XjxnWcWjvsMzIhGOg20RsBHl5XeO01r4E/oqAzfKr2 SxZgqUmi9ptOQfM6OsX80ejl6TLrxTW8UYYmXDxjti983biBfwXwGBZu9aQr60KR jtdh6kbdDDWISOgz4XuFnSAM4yJypY/JkLApjM8xsh5lZ9X9nkgCEAFuPwcB4Bof ptUwVKdDhPf5HnDyopnFpI/6t4beFTb1ajLWDyrZZFgwW7BUZWLYXkS0CUAui5wm SCL2hb3IiwXqow/p9WbIuG7SOEgrYUiQLKf62YMFO/pDqDl3DVnocT5fmaNMFFf8 9eGHtn+e+t20L5RxIeF3Tn/bE3fv+CmxaD7cQeSsH2rnsP1QL+11JUjbgBWrqPjv sPAT3wFw+Jp93nnVNkSNkgrwsNrbxWzYK8yfyCakD0DJLYCSiIzscTVkmCLrDOtJ dHg+onAyqGYtiCBmhhYARt0gvsmfrl8UBBeY4qb4dKNEZzaHC6/XvZxCIyaoJd6G wk1qhptrH9CWpS3blzKx =Mc0k -----END PGP SIGNATURE----- --AzNpbZlgThVzWita--