From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK0xu-0005fz-VQ for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK0xo-0000Nc-Mi for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:09:54 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK0xo-0000NX-HD for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:09:48 -0400 Received: by mail-pd0-f177.google.com with SMTP id p10so11230478pdj.22 for ; Wed, 20 Aug 2014 01:09:47 -0700 (PDT) Message-ID: <53F457BE.9080701@ozlabs.ru> Date: Wed, 20 Aug 2014 18:09:34 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1408097555-28126-1-git-send-email-aik@ozlabs.ru> <1408097555-28126-3-git-send-email-aik@ozlabs.ru> <20140819004330.GB26479@voom.fritz.box> In-Reply-To: <20140819004330.GB26479@voom.fritz.box> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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: David Gibson Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Gavin Shan , Alexander Graf On 08/19/2014 10:43 AM, David Gibson wrote: > 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. >> >> 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. >> >> 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. That exactly the point. I'll steal these bit and commit log will start with: === The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max a 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(-) >> >> 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 = { >> static int spapr_tce_table_realize(DeviceState *dev) >> { >> sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev); >> + uint64_t window_size = 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. Oh. Thanks. /me is thinking how to catch this kind of errors from a script... -- Alexey