diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-08-30 18:10:38 +1000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-10-17 17:24:14 +0200 |
commit | a66670c79c5c7d530d818430ffcdaa25cbf2c2ab (patch) | |
tree | e48a351494c3fb6aece8fc75056c390fd1f06d6b | |
parent | 1680d485777ecf436d724631ea8722cc0c66990e (diff) |
memory: fix 128 arithmetic in info mtree
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 <aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | memory.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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", |