Hi friends,
I am working on a user level kvm tool based on KVM/ARM. Right now it is quite primitive. It creates a vm and loads a binary image to the address space of the vm, then runs the vcpu.
But the problem is it gets into KVM_RUN ioctl and is never able to get out of it.
I use ftrace to trace the function calls and I see what is happening is:
kvm_arch_vcpu_ioctl_run->
I am working on a user level kvm tool based on KVM/ARM. Right now it is quite primitive. It creates a vm and loads a binary image to the address space of the vm, then runs the vcpu.
But the problem is it gets into KVM_RUN ioctl and is never able to get out of it.
I use ftrace to trace the function calls and I see what is happening is:
kvm_arch_vcpu_ioctl_run->
handle_exit->
exit_handler (which is kvm_handle_guest_abort)->
kvm_inject_pabt /* Prefetch Abort on I/O address */ (this is the comment in that if condition)
Then it keeps returning 1 until back to kvm_arch_vcpu_ioctl, where there is a while loop checking if the return value is greater than 0. And since it is 1, it just keeps doing the above loop.
Then it keeps returning 1 until back to kvm_arch_vcpu_ioctl, where there is a while loop checking if the return value is greater than 0. And since it is 1, it just keeps doing the above loop.
I don't how it ended up prefetching instructions from an I/O address.
The arguments i used when calling ioctl(KVM_SET_USER_MEMORY_REGION) is:
.guest_phys_addr = 0x0000000080000000UL
.memory_size = 1024 * 1024
.userspace_addr = mmap(NULL, ram_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_NORESERVE | MAP_PRIVATE, -1, 0);
When loading image, i read a binary image to userspace address mapped to 0x0000000080000000UL. What the binary image does it just:
mov r0, #5
mov r1, #4
add r2, r1, r0
And before running, i set pc to 0x0000000080000000UL. Then i run it.
What did i do wrong? Can you offer me some hints?
Thank you very much!!
Tom.
_______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm