vmm: Rename userspace's gvatogpa() -> gva2gpa() This will match the kernel's name. It's mostly for my convenience when trying to find the function in the future. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/user/vmm/include/vmm/vmm.h b/user/vmm/include/vmm/vmm.h index e01fb37..0cb0fb0 100644 --- a/user/vmm/include/vmm/vmm.h +++ b/user/vmm/include/vmm/vmm.h
@@ -93,7 +93,7 @@ uint64_t **regp, int *store, int *size, int *advance); int io(struct guest_thread *vm_thread); void showstatus(FILE *f, struct guest_thread *vm_thread); -int gvatogpa(struct guest_thread *vm_thread, uint64_t va, uint64_t *pa); +int gva2gpa(struct guest_thread *vm_thread, uint64_t va, uint64_t *pa); int rippa(struct guest_thread *vm_thread, uint64_t *pa); int msrio(struct guest_thread *vm_thread, struct vmm_gpcore_init *gpci, uint32_t opcode);
diff --git a/user/vmm/util.c b/user/vmm/util.c index eead7cb..63a6b07 100644 --- a/user/vmm/util.c +++ b/user/vmm/util.c
@@ -75,7 +75,7 @@ guest_pc); if (!guest_fp) break; - if (gvatogpa(vm_thread, guest_fp, &host_fp)) + if (gva2gpa(vm_thread, guest_fp, &host_fp)) break; memcpy(frame, (void*)host_fp, 2 * sizeof(uintptr_t)); guest_pc = frame[1];
diff --git a/user/vmm/vmx.c b/user/vmm/vmx.c index 8528958..f3f285b 100644 --- a/user/vmm/vmx.c +++ b/user/vmm/vmx.c
@@ -43,12 +43,8 @@ backtrace_guest_thread(f, vm_thread); } -/* Convert a kernel guest virtual address to physical address. - * Assumes that the guest VA is in the high negative address space. - * TODO: Takes the vm_thread argument so that we can walk the page tables - * instead of just coercing the pointer. Therefore, this is not in vmm.h - * since it may get complex. */ -int gvatogpa(struct guest_thread *vm_thread, uint64_t va, uint64_t *pa) +/* Convert a guest virtual address to physical address. */ +int gva2gpa(struct guest_thread *vm_thread, uint64_t va, uint64_t *pa) { assert(vm_thread != NULL); struct vm_trapframe *vm_tf = gth_to_vmtf(vm_thread); @@ -78,5 +74,5 @@ int rippa(struct guest_thread *vm_thread, uint64_t *pa) { assert(vm_thread != NULL); - return gvatogpa(vm_thread, gth_to_vmtf(vm_thread)->tf_rip, pa); + return gva2gpa(vm_thread, gth_to_vmtf(vm_thread)->tf_rip, pa); }