Message ID | 81c92413-024a-5448-1160-b24ca944e88e@ilande.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, > - unsigned long align = 1 << (TARGET_PAGE_BITS + BITS_PER_LEVEL); > + unsigned long align = 1UL << (TARGET_PAGE_BITS + BITS_PER_LEVEL); > There were 2 issues here: without the UL suffix on align I was getting > incorrect first/last addresses since the high bits of align weren't > being cleared, Ah, thanks, I'll add that. > and then offset appeared to be shifted twice. Yep, noticed that too meanwhile, fixed in the branch pushed half an hour ago. I've dropped the other shift though ;) cheers, Gerd
On 04/04/17 07:12, Gerd Hoffmann wrote: > Hi, > >> - unsigned long align = 1 << (TARGET_PAGE_BITS + BITS_PER_LEVEL); >> + unsigned long align = 1UL << (TARGET_PAGE_BITS + BITS_PER_LEVEL); > >> There were 2 issues here: without the UL suffix on align I was getting >> incorrect first/last addresses since the high bits of align weren't >> being cleared, > > Ah, thanks, I'll add that. > >> and then offset appeared to be shifted twice. > > Yep, noticed that too meanwhile, fixed in the branch pushed half an hour > ago. I've dropped the other shift though ;) Confirmed! The only minor nit I've noticed is that commit 322aef7 "cg3: fix up size parameter for memory_region_get_dirty()" isn't quite right now that the asserts() in cpu_physical_memory_snapshot_get_dirty() have now been fixed - the size should now be "width" rather than "width - 1". Other than that, I've just given it a quick spin across my SPARC CG3/TCX and PPC VGA images and it looks good here :) ATB, Mark.
diff --git a/exec.c b/exec.c index 000af18..66bdcf4 100644 --- a/exec.c +++ b/exec.c @@ -1071,7 +1071,7 @@ DirtyBitmapSnapshot *cpu_physical_memory_snapshot_and_clear_dirty (ram_addr_t start, ram_addr_t length, unsigned client) { DirtyMemoryBlocks *blocks; - unsigned long align = 1 << (TARGET_PAGE_BITS + BITS_PER_LEVEL); + unsigned long align = 1UL << (TARGET_PAGE_BITS + BITS_PER_LEVEL); ram_addr_t first = QEMU_ALIGN_DOWN(start, align); ram_addr_t last = QEMU_ALIGN_UP(start + length, align);