From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCQ8W-0001n6-27 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 04:21:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCQ8P-0007tp-T9 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 04:20:56 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:39370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCQ8P-0007tl-Im for qemu-devel@nongnu.org; Thu, 22 Aug 2013 04:20:49 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj1so1894703pad.14 for ; Thu, 22 Aug 2013 01:20:48 -0700 (PDT) From: Alexey Kardashevskiy Date: Thu, 22 Aug 2013 18:20:31 +1000 Message-Id: <1377159632-7446-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1377159632-7446-1-git-send-email-aik@ozlabs.ru> References: <1377159632-7446-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v2 2/3] vfio: Fix debug output for int128 values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Paolo Bonzini , Alex Williamson 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 --- 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 017e693..dfe3a80 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -1928,7 +1928,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; } @@ -1973,7 +1974,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; } -- 1.8.4.rc4