When talking to the kernel about dirty maps, we need to find out
bits were actually set. This is done by set_bit and test_bit like
functiontality which uses the "long" variable type.
Now, with PPC32 userspace and PPC64 kernel space (which is pretty
we can't interpret the bits properly anymore, because we think long
32 bits wide.
So for PPC dirty bitmap analysis, let's just assume we're always
on a PPC64 host. Currently there is no dirty bitmap implementation
PPC32 / PPCEMB anyways.
Unbreaks dirty logging on PPC.
Signed-off-by: Alexander Graf <address@hidden>
kvm-all.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 824bb4c..bfaa623 100644
@@ -357,7 +357,13 @@ int
for (phys_addr = mem->start_addr, addr = mem->phys_offset;
phys_addr < mem->start_addr + mem->memory_size;
phys_addr += TARGET_PAGE_SIZE, addr +=
+ /* Big endian keeps us from having different long
sizes in user and
+ * kernel space, so assume we're always on ppc64. */
+ uint64_t *bitmap = (uint64_t *)d.dirty_bitmap;
unsigned long *bitmap = (unsigned long *)d.dirty_bitmap;
unsigned nr = (phys_addr - mem->start_addr) >>
unsigned word = nr / (sizeof(*bitmap) * 8);
unsigned bit = nr % (sizeof(*bitmap) * 8);