From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH1e7-0001WF-DC for qemu-devel@nongnu.org; Mon, 11 Aug 2014 22:17:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XH1e2-0003qY-8B for qemu-devel@nongnu.org; Mon, 11 Aug 2014 22:17:07 -0400 Date: Tue, 12 Aug 2014 11:17:24 +1000 From: David Gibson Message-ID: <20140812011724.GA7628@voom.redhat.com> References: <1406799254-25223-1-git-send-email-aik@ozlabs.ru> <1406799254-25223-3-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <1406799254-25223-3-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [RFC PATCH 02/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows 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, Alexander Graf --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 31, 2014 at 07:34:06PM +1000, Alexey Kardashevskiy wrote: > The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max. > We are going to add huge DMA windows support so this will create small > window and unexpectedly fail later. I'm not entirely clear on what you're saying here. Are you saying that the kernel interface silently truncates a window > 4G, rather than failing? If so, that's a kernel bug which should be addressed - obviously we'd still need this as a workaround for older kernels, but it should be treated as a workaround, not as the real fix. > This disables KVM_CREATE_SPAPR_TCE for windows bigger that 4GB. Since > those windows are normally mapped at the boot time, there will be no > performance impact. >=20 > Signed-off-by: Alexey Kardashevskiy > --- > hw/ppc/spapr_iommu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > index f6e32a4..36f5d27 100644 > --- a/hw/ppc/spapr_iommu.c > +++ b/hw/ppc/spapr_iommu.c > @@ -113,11 +113,11 @@ static MemoryRegionIOMMUOps spapr_iommu_ops =3D { > static int spapr_tce_table_realize(DeviceState *dev) > { > sPAPRTCETable *tcet =3D SPAPR_TCE_TABLE(dev); > + uint64_t window_size =3D tcet->nb_table << tcet->page_shift; > =20 > - if (kvm_enabled()) { > + if (kvm_enabled() && !(window_size >> 32)) { > tcet->table =3D kvmppc_create_spapr_tce(tcet->liobn, > - tcet->nb_table << > - tcet->page_shift, > + window_size, > &tcet->fd, > tcet->vfio_accel); > } --=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 --jRHKVT23PllUwdXP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT6WskAAoJEGw4ysog2bOSG+oP/1W8bwDkTtMpNhZok4R1pkt3 y/ci4m7aUQdhPALJgID6msEJGVug3rpxJQK2jUfkCDk+8f76GzNC6UxwdqEe+kta eCw5peDWFuTtLbIQVEfgerxxyF3uRh+OIs93UvTFOxw1yTQLJwB2cFF3eWXBr6yM mXHfeeDleBiDFMliIumehaphGtaK61C8gDGcmPzPvjnv9AaOQDykb49MAYfbFVxB fltVOKcb68hB5tQKtGF2DTYsTp0S000LYhgb9dmcrpmJDtqHnP8iGIRpFWvGs6S3 ZrWocztG9/XvBHl55KRjGkMHZsxMeg42VCDJ9yDWsFtYjpJgQkQZt8Tx/z0QPKBe fk8XrvknxRUcEcgY9AyhmYdS43XWzjhNEzoNtQD7vviAKNcRdrCwYmeyVR/Wcgn1 u6UsPfYt/XPKuiYRszHnsipxXqCmrm/pEcbjYTbg/napvYcH8ft8/kaOQgJmGofi agX4bgmV0+IZ5LStXkqT0fjUw+IM20PiK2X+XzW3x2HVZFHE7J99TWxCCvTsWJN8 /+4tIZfi7P3XCewTpTZzVAXqJgKlNeYNcBQBHTQ5ieUtLAFk4y4kAWLFMOyiuhoG lidARtquAfJM4FQ9tOqAr9NZ92YqQzNGcYUiGRSQZs8P6j+UIwynwsMdY1XyiW2J qzZTO0GOMJ+6HdRt5Z+U =EgvT -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--