From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCQwb-0008Bt-Ii for qemu-devel@nongnu.org; Thu, 22 Aug 2013 05:12:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCQwV-0001zU-D1 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 05:12:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCQwV-0001zK-52 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 05:12:35 -0400 Message-ID: <5215D5D8.6070205@redhat.com> Date: Thu, 22 Aug 2013 11:11:52 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1377159632-7446-1-git-send-email-aik@ozlabs.ru> <1377159632-7446-4-git-send-email-aik@ozlabs.ru> In-Reply-To: <1377159632-7446-4-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/3] vfio: Fix 128 bit handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alex Williamson , qemu-devel@nongnu.org Il 22/08/2013 10:20, Alexey Kardashevskiy ha scritto: > iova = TARGET_PAGE_ALIGN(section->offset_within_address_space); > - end = (section->offset_within_address_space + int128_get64(section->size)) & > - TARGET_PAGE_MASK; > + llend = int128_make64(section->offset_within_address_space); > + llend = int128_add(llend, section->size); > + llend = int128_and(llend, int128_exts64(TARGET_PAGE_MASK)); > > - if (iova >= end) { > + if (int128_ge(int128_make64(iova), llend)) { > return; > } > > + end = (section->offset_within_address_space + int128_get64(section->size)) & > + TARGET_PAGE_MASK; > + This can still fail for section->size = 2^64. Do your IOMMU patches take care of it? Paolo