From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJXXX-00076R-Cb for qemu-devel@nongnu.org; Mon, 18 Aug 2014 20:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJXXS-000244-N4 for qemu-devel@nongnu.org; Mon, 18 Aug 2014 20:44:43 -0400 Date: Tue, 19 Aug 2014 10:43:30 +1000 From: David Gibson Message-ID: <20140819004330.GB26479@voom.fritz.box> References: <1408097555-28126-1-git-send-email-aik@ozlabs.ru> <1408097555-28126-3-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BwCQnh7xodEAoBMC" Content-Disposition: inline In-Reply-To: <1408097555-28126-3-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [RFC PATCH v2 02/13] 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, Gavin Shan , Alexander Graf --BwCQnh7xodEAoBMC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 15, 2014 at 08:12:24PM +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. >=20 > 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 I think perhaps the crucial point here is that the window size parameter to the kernel ioctl() is only 32-bit, so there's no way of expressing a TCE window > 4GB. > --- > 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; tcet->nb_table is only 32-bit itself, so this isn't going to work as intended without a cast. --=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 --BwCQnh7xodEAoBMC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT8p2yAAoJEGw4ysog2bOSg3QP/1Kuoe9h4Jkj1XgMZm2JqqOW gIEIbXxMkC73k68ulPLpK2rhRREsiO2VfUuW+DKJvF385kqTvnC3uyFFqHeE0nHu cHHhXD398+aN+9Bo6uD2DiuHuy1BVW4V8G+4jM9iAn8nedk0S7TlaLLm7fLxXVNd 9j13ImyG0sbkVKcdIIALUzfURY2t7zP//b5JT60yciPHAAU0H82nVEp/bNNU/S02 88Nzn721EGiGh/d1CfDUQQ40KKRc+uIAIcjfgArDY62kfFskLDisVktIeiK3jdex fOIoWGC5w9a4SE9enOvko/Ch4g6CnTmbBqh4/Y3uS6Je1Ab48PZoohmggeuosZnX fQhslTNYe9J3pUGnAVmTKMkFav38BsdhON+LcXPrSjhk0jKiWPD66RfhRwyAGF0Y Jev7ye37AP4adgHYmqxtR34PUKWxnoayGJJ2H9Cd1+y1GYDhAl5Dzs5r2U1JnzIf lfLiB9ujWAUpolIqON2RxS0UVi2Sfbz8rwCVVYOXHQloBUqUTvCytiZIzlaNOzhp OC8Kt67KN/zS1mX5/iPwKAao+jJSDhBKN9gC8tRn8MpHx5QDlSVxPFJU3cDEChuK xrNE4pthKst/O1gy6vSGuK8VoOo97ppPdux5J+1A/5isQAqt7xsoWv0kRPvSZCZZ Lxoc9cn0v2yu+0ja9fIB =7yRi -----END PGP SIGNATURE----- --BwCQnh7xodEAoBMC--