Message ID | 51C30F85.400@redhat.com |
---|---|
State | New |
Headers | show |
On 20 June 2013 15:19, Paolo Bonzini <pbonzini@redhat.com> wrote: > Il 20/06/2013 15:53, Peter Maydell ha scritto: >> There are other places in memory.c which do an int128_get64() >> on mr->size, which also look suspicious... > > They are all on I/O regions so they are safe Not entirely sure I understand this. There's no particular reason I can't create a 2^64 sized I/O memory region and put it in an address space, is there? thanks -- PMM
Il 20/06/2013 16:43, Peter Maydell ha scritto: >>> >> There are other places in memory.c which do an int128_get64() >>> >> on mr->size, which also look suspicious... >> > >> > They are all on I/O regions so they are safe > Not entirely sure I understand this. There's no particular > reason I can't create a 2^64 sized I/O memory region > and put it in an address space, is there? I think there are problems in the core if you do that (probably part of it is fixed now). Still, in cases like this: memory_region_add_coalescing(mr, 0, int128_get64(mr->size)); the API simply doesn't support it. Paolo
diff --git a/memory.c b/memory.c index c500d8d..47b005a 100644 --- a/memory.c +++ b/memory.c @@ -1744,7 +1744,7 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, "-" TARGET_FMT_plx "\n", base + mr->addr, base + mr->addr - + (hwaddr)int128_get64(mr->size) - 1, + + (hwaddr)int128_get64(int128_sub(mr->size, int128_make64(1))), mr->priority, mr->romd_mode ? 'R' : '-', !mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W' @@ -1759,7 +1759,7 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n", base + mr->addr, base + mr->addr - + (hwaddr)int128_get64(mr->size) - 1, + + (hwaddr)int128_get64(int128_sub(mr->size, int128_make64(1))), mr->priority, mr->romd_mode ? 'R' : '-', !mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'