memory: Fix zero-sized memory region print
if mr->size == 0, then int128_get64(int128_sub(mr->size, int128_make64(1))) => assert(!a.hi) Also, use int128_one(). Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20130719184124.15864.20803.stgit@bling.home Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
53db78543e
commit
fd1d9926e9
8
memory.c
8
memory.c
@ -1787,7 +1787,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
|
|||||||
"-" TARGET_FMT_plx "\n",
|
"-" TARGET_FMT_plx "\n",
|
||||||
base + mr->addr,
|
base + mr->addr,
|
||||||
base + mr->addr
|
base + mr->addr
|
||||||
+ (hwaddr)int128_get64(int128_sub(mr->size, int128_make64(1))),
|
+ (int128_nz(mr->size) ?
|
||||||
|
(hwaddr)int128_get64(int128_sub(mr->size,
|
||||||
|
int128_one())) : 0),
|
||||||
mr->priority,
|
mr->priority,
|
||||||
mr->romd_mode ? 'R' : '-',
|
mr->romd_mode ? 'R' : '-',
|
||||||
!mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
|
!mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
|
||||||
@ -1802,7 +1804,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
|
|||||||
TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
|
TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
|
||||||
base + mr->addr,
|
base + mr->addr,
|
||||||
base + mr->addr
|
base + mr->addr
|
||||||
+ (hwaddr)int128_get64(int128_sub(mr->size, int128_make64(1))),
|
+ (int128_nz(mr->size) ?
|
||||||
|
(hwaddr)int128_get64(int128_sub(mr->size,
|
||||||
|
int128_one())) : 0),
|
||||||
mr->priority,
|
mr->priority,
|
||||||
mr->romd_mode ? 'R' : '-',
|
mr->romd_mode ? 'R' : '-',
|
||||||
!mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
|
!mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
|
||||||
|
Loading…
Reference in New Issue
Block a user