int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa) {
- if (guest_info->shdw_pg_mode == SHADOW_PAGING) {
- if (guest_info->mem_mode == PHYSICAL_MEM) {
- // guest virtual address is the same as the physical
- *guest_pa = guest_va;
- return 0;
- }
-
-
+ if (guest_info->mem_mode == PHYSICAL_MEM) {
+ // guest virtual address is the same as the physical
+ *guest_pa = guest_va;
+ return 0;
+ }
+
+ if (guest_info->shdw_pg_mode == SHADOW_PAGING) {
// Guest Is in Paged mode
switch (guest_info->cpu_mode) {
case PROTECTED:
} else if (guest_info->shdw_pg_mode == NESTED_PAGING) {
// Fill in
-
+ return -1;
} else {
return -1;
}
/* JRL FIXME:
* This should be somewhere else....
*/
- addr_t tmp_addr;
+ /*
+ addr_t tmp_addr;
addr_t shadow_pde = CR3_TO_PDE32(guest_info->shdw_pg_state.shadow_cr3);
return bytes_read;
}
}
+*/
/* JRL: END GRUESOME HACK */
- /*
- if (guest_va_to_host_va(guest_info, cursor, &host_addr) != 0) {
+
+ if (guest_va_to_host_va(guest_info, cursor, &host_addr) != 0) {
PrintDebug("Invalid GVA(%x)->HVA lookup\n", cursor);
return bytes_read;
- }
- */
+ }
+
memcpy(dest + bytes_read, (void*)host_addr, bytes_to_copy);