@@ -125,7 +125,7 @@ int main(int ac, char **av)
printf("dirty-log-perf: Could not allocate guest memory.\n");
exit(1);
}
- uint64_t mem_addr = reinterpret_cast<uint64_t>(mem_head);
+ uint64_t mem_addr = reinterpret_cast<uintptr_t>(mem_head);
identity::hole hole(mem_head, mem_size);
identity::vm ident_vm(vm, memmap, hole);
@@ -62,7 +62,7 @@ int main(int ac, char **av)
bool running = true;
int nr_fail = 0;
mem_slot logged_slot(memmap,
- reinterpret_cast<uint64_t>(logged_slot_virt),
+ reinterpret_cast<uintptr_t>(logged_slot_virt),
4096, logged_slot_virt);
boost::thread host_poll_thread(check_dirty_log, ref(logged_slot),
ref(running),
@@ -18,7 +18,7 @@ hole::hole(void* address, size_t size)
vm::vm(kvm::vm& vm, mem_map& mmap, hole h)
{
- uint64_t hole_gpa = reinterpret_cast<uint64_t>(h.address);
+ uint64_t hole_gpa = reinterpret_cast<uintptr_t>(h.address);
char* hole_hva = static_cast<char*>(h.address);
if (h.address) {
_slots.push_back(mem_slot_ptr(new mem_slot(mmap, 0, hole_gpa, NULL)));
@@ -51,7 +51,7 @@ void vcpu::setup_sregs()
asm ("mov %%gs:0, %0" : "=r"(gsbase));
sregs.gs.base = gsbase;
- sregs.tr.base = reinterpret_cast<ulong>(&*_stack.begin());
+ sregs.tr.base = reinterpret_cast<uintptr_t>(&*_stack.begin());
sregs.tr.type = 11;
sregs.tr.s = 0;
sregs.tr.present = 1;
@@ -159,7 +159,7 @@ void vm::set_memory_region(int slot, void *addr, uint64_t gpa, size_t len,
umr.flags = flags;
umr.guest_phys_addr = gpa;
umr.memory_size = len;
- umr.userspace_addr = reinterpret_cast<uint64_t>(addr);
+ umr.userspace_addr = reinterpret_cast<uintptr_t>(addr);
_fd.ioctlp(KVM_SET_USER_MEMORY_REGION, &umr);
}
This will sign extend pointers that have bit 31 set. Go through uintptr_t instead, so that the next conversion to uint64_t will zero-extend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- api/dirty-log-perf.cc | 2 +- api/dirty-log.cc | 2 +- api/identity.cc | 4 ++-- api/kvmxx.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)