From patchwork Thu Oct 3 15:39:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 280370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2861C2C00C1 for ; Fri, 4 Oct 2013 01:40:46 +1000 (EST) Received: from localhost ([::1]:43850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRl1A-00052c-1k for incoming@patchwork.ozlabs.org; Thu, 03 Oct 2013 11:40:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRl0X-0004tI-Ry for qemu-devel@nongnu.org; Thu, 03 Oct 2013 11:40:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRl0S-0002SU-Nt for qemu-devel@nongnu.org; Thu, 03 Oct 2013 11:40:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRl0S-0002SH-GT for qemu-devel@nongnu.org; Thu, 03 Oct 2013 11:40:00 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r93FdxTZ001819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Oct 2013 11:39:59 -0400 Received: from bling.home (ovpn-113-59.phx2.redhat.com [10.3.113.59]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r93FdwkU032447; Thu, 3 Oct 2013 11:39:58 -0400 To: anthony@codemonkey.ws From: Alex Williamson Date: Thu, 03 Oct 2013 09:39:58 -0600 Message-ID: <20131003153943.26487.458.stgit@bling.home> In-Reply-To: <20131003153601.26487.70022.stgit@bling.home> References: <20131003153601.26487.70022.stgit@bling.home> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PULL 6/6] vfio: Fix debug output for int128 values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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; }