From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoDXl-0001tA-6Q for qemu-devel@nongnu.org; Wed, 04 Dec 2013 09:35:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoDXY-0002ok-NY for qemu-devel@nongnu.org; Wed, 04 Dec 2013 09:35:13 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:56981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoDXY-0002oY-Fc for qemu-devel@nongnu.org; Wed, 04 Dec 2013 09:35:00 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Dec 2013 07:34:59 -0700 From: Michael Roth Date: Wed, 4 Dec 2013 08:34:21 -0600 Message-Id: <1386167679-13021-15-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1386167679-13021-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1386167679-13021-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 14/32] memory: fix 128 arithmetic in info mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Alexey Kardashevskiy mtree_print_mr() calls int128_get64() in 3 places but only 2 places handle 2^64 correctly. This fixes the third call of int128_get64(). Cc: qemu-stable@nongnu.org Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini (cherry picked from commit a66670c79c5c7d530d818430ffcdaa25cbf2c2ab) Signed-off-by: Michael Roth --- memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory.c b/memory.c index 5a10fd0..7f1f266 100644 --- a/memory.c +++ b/memory.c @@ -1809,7 +1809,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, mr->alias->name, mr->alias_offset, mr->alias_offset - + (hwaddr)int128_get64(mr->size) - 1); + + (int128_nz(mr->size) ? + (hwaddr)int128_get64(int128_sub(mr->size, + int128_one())) : 0)); } else { mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n", -- 1.7.9.5