Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEXgm-0006xT-Hz for qemu-devel@nongnu.org; Mon, 13 Jul 2015 02:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEXgg-0006Km-WC for qemu-devel@nongnu.org; Mon, 13 Jul 2015 02:58:08 -0400 Date: Mon, 13 Jul 2015 16:15:39 +1000 From: David Gibson Message-ID: <20150713061539.GB4121@voom.redhat.com> References: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> <1436525028-23963-2-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XOIedfhf+7KOe/yw" Content-Disposition: inline In-Reply-To: <1436525028-23963-2-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu 1/5] vfio: Switch from TARGET_PAGE_MASK to qemu_real_host_page_mask 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 --XOIedfhf+7KOe/yw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 10, 2015 at 08:43:44PM +1000, Alexey Kardashevskiy wrote: > These started switching from TARGET_PAGE_MASK (hardcoded as 4K) to > a real host page size: > 4e51361d7 "cpu-all: complete "real" host page size API" and > f7ceed190 "vfio: cpu: Use "real" page size API" >=20 > This finished the transition by: > - %s/TARGET_PAGE_MASK/qemu_real_host_page_mask/ > - %s/TARGET_PAGE_ALIGN/REAL_HOST_PAGE_ALIGN/ > - removing bitfield length for offsets in VFIOQuirk::data as > qemu_real_host_page_mask is not a macro This does not make much sense to me. f7ceed190 moved to REAL_HOST_PAGE_SIZE because it's back end stuff that really depends only on the host page size. Here you're applying a blanket change to vfio code, in particular to the DMA handling code, and for DMA both the host and target page size can be relevant, depending on the details of the IOMMU implementation. > This keeps using TARGET_PAGE_MASK for IOMMU regions though as it is > the minimum page size which IOMMU regions may be using and at the moment > memory regions do not carry the actual page size. And this exception also doesn't make much sense to me. Partly it's confusing because the listener is doing different things depending on whether we have a guest visible IOMMU or not. In short, there doesn't seem to be a coherent explanation here of where the page size / alignment restriction is coming from, and therefore whether it needs to be a host page alignment, a guest page alignment, or both. > Signed-off-by: Alexey Kardashevskiy > --- >=20 > In reality DMA windows are always a lot bigger than a single 4K page > and aligned to 32/64MB, may be only use here > qemu_real_host_page_mask? I don't understand this question either. --=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 --XOIedfhf+7KOe/yw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVo1eLAAoJEGw4ysog2bOSF9gQANcd7m7MgbsdLpr9CQdZe8x0 szb9iInt0nSdEgi03XJOV9eUfqAmajZO65IwcR3RNaZFSCKPDVb/zhhNORTZAZsz XJVbnDOTU7v8PajkTCR8K+uLIGCp0FAvzWZO+uXUFHXQRSx0ttMLwI0LsK6bKZR9 EBlTmP14jJrnG3RsD3mbboE4tfM0EmrZXEDctVoV5nSQByxJ844+8arm5I6MUJvZ DWnTfPQI40KvKLDVjNBAOXf/lNodxcu9sre3SUxrcP3Eu4WGDzbl0YehFBZtqMdp xNw/j/1ZoV2bG6Y7+F/FXHcFDWtjkxU1zBCgtSJ8jm2fPolJ/LqUA8ZgLMUXsL2e UZ94fFPnD8FTWtOcb7BrYPcMpFFJJbSn6IFnByi/PAY0dsfwswZMSw2mI1yuQFTm F23nqOSZicSychPW9UjVKcKKtv/RyV9JGou+up3kfKiHUjsaMld00i9wJVay/4sg BoyyasuDwClBrAqy8rsmH2iaRiXdYjkeDzG3euqzQ/5wjUGc5OsRXXZaVX/eDfFz uKK9NmCJusFP8sIESjySfvzOlSg7Tr4zlx2efiOrTHV9cfSiyoSiSHQ1NqlxV4CC /ThwnA/1OunLbZSgTByUv39OSsflKYFoCXfXzYDqGgVdOQ+NMQ4353aMuHoqpN6N /T4dIQkJxclqe/GLCZ0X =jLhv -----END PGP SIGNATURE----- --XOIedfhf+7KOe/yw--