From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFJnK-0004wS-R6 for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:11:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFJnC-0003ll-Jq for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:11:02 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:52883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFJnB-0003lW-D7 for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:10:54 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 31 Aug 2013 05:04:49 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 500423578053 for ; Fri, 30 Aug 2013 18:10:44 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7U7sXYx2949474 for ; Fri, 30 Aug 2013 17:54:35 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7U8Afsl031139 for ; Fri, 30 Aug 2013 18:10:41 +1000 From: Alexey Kardashevskiy Date: Fri, 30 Aug 2013 18:10:38 +1000 Message-Id: <1377850238-10270-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH] 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: Alexey Kardashevskiy , Paolo Bonzini 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(). Signed-off-by: Alexey Kardashevskiy --- memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory.c b/memory.c index ffedde7..93f2995 100644 --- a/memory.c +++ b/memory.c @@ -1816,7 +1816,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.8.4.rc4