From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VULE8-00035P-Rj for qemu-devel@nongnu.org; Thu, 10 Oct 2013 14:44:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VULE3-0007T2-Gx for qemu-devel@nongnu.org; Thu, 10 Oct 2013 14:44:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VULE2-0007Ss-Ar for qemu-devel@nongnu.org; Thu, 10 Oct 2013 14:44:43 -0400 From: Alex Williamson Date: Thu, 10 Oct 2013 12:44:39 -0600 Message-ID: <20131010184433.31667.17887.stgit@bling.home> In-Reply-To: <20131010184122.31667.28382.stgit@bling.home> References: <20131010184122.31667.28382.stgit@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PULL v2 6/8] vfio: Fix debug output for int128 values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Alexey Kardashevskiy Memory regions can easily be 2^64 byte long and therefore overflow for just a bit but that is enough for int128_get64() to assert. This takes care of debug printing of huge section sizes. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Alex Williamson --- hw/misc/vfio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index 0c9bb95..68e25bd 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -2084,7 +2084,8 @@ static void vfio_listener_region_add(MemoryListener *listener, if (vfio_listener_skipped_section(section)) { DPRINTF("SKIPPING region_add %"HWADDR_PRIx" - %"PRIx64"\n", section->offset_within_address_space, - section->offset_within_address_space + section->size - 1); + section->offset_within_address_space + + int128_get64(int128_sub(section->size, int128_one()))); return; } @@ -2129,7 +2130,8 @@ static void vfio_listener_region_del(MemoryListener *listener, if (vfio_listener_skipped_section(section)) { DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n", section->offset_within_address_space, - section->offset_within_address_space + section->size - 1); + section->offset_within_address_space + + int128_get64(int128_sub(section->size, int128_one()))); return; }