From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOmcW-0004g9-6R for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:47:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOmcP-0008Ts-SQ for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:47:00 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:65464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOmcP-0008Te-ME for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:46:53 -0400 Received: by mail-pb0-f54.google.com with SMTP id ro12so5916352pbb.27 for ; Wed, 25 Sep 2013 03:46:52 -0700 (PDT) Message-ID: <5242BF17.80704@ozlabs.ru> Date: Wed, 25 Sep 2013 20:46:47 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1377850238-10270-1-git-send-email-aik@ozlabs.ru> <522E9DE0.8020508@ozlabs.ru> In-Reply-To: <522E9DE0.8020508@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Paolo Bonzini , qemu-devel@nongnu.org On 09/10/2013 02:19 PM, Alexey Kardashevskiy wrote: > On 08/30/2013 06:10 PM, Alexey Kardashevskiy wrote: >> 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", >> > > > Ping? Ping? -- Alexey