X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvm_guest.c;h=1eee109fde08e52bba233a4a6c75afc4a200ccbd;hb=785b7105d35b97c6e7a176facc29a2efdb234951;hp=d5faa6cef948f111594d62c3842f725ec42d4ddb;hpb=e31890ea7a0f024ab8d0e8bf1f8446d4c714ef61;p=palacios.git diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index d5faa6c..1eee109 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -26,7 +26,7 @@ #include -v3_vm_cpu_mode_t v3_get_cpu_mode(struct guest_info * info) { +v3_cpu_mode_t v3_get_vm_cpu_mode(struct guest_info * info) { struct cr0_32 * cr0; struct efer_64 * efer; struct cr4_32 * cr4 = (struct cr4_32 *)&(info->ctrl_regs.cr4); @@ -63,13 +63,16 @@ v3_vm_cpu_mode_t v3_get_cpu_mode(struct guest_info * info) { uint_t v3_get_addr_width(struct guest_info * info) { struct cr0_32 * cr0; struct cr4_32 * cr4 = (struct cr4_32 *)&(info->ctrl_regs.cr4); - struct efer_64 * efer = (struct efer_64 *)&(info->guest_efer); + struct efer_64 * efer; struct v3_segment * cs = &(info->segments.cs); + vmcb_saved_state_t * guest_state = GET_VMCB_SAVE_STATE_AREA((vmcb_t*)(info->vmm_data)); if (info->shdw_pg_mode == SHADOW_PAGING) { cr0 = (struct cr0_32 *)&(info->shdw_pg_state.guest_cr0); + efer = (struct efer_64 *)&(info->guest_efer); } else if (info->shdw_pg_mode == NESTED_PAGING) { cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0); + efer = (struct efer_64 *)&(guest_state->efer); } else { PrintError("Invalid Paging Mode...\n"); V3_ASSERT(0); @@ -98,7 +101,7 @@ static const uchar_t LONG_STR[] = "Long"; static const uchar_t LONG_32_COMPAT_STR[] = "32bit Compat"; static const uchar_t LONG_16_COMPAT_STR[] = "16bit Compat"; -const uchar_t * v3_cpu_mode_to_str(v3_vm_cpu_mode_t mode) { +const uchar_t * v3_cpu_mode_to_str(v3_cpu_mode_t mode) { switch (mode) { case REAL: return REAL_STR; @@ -117,7 +120,7 @@ const uchar_t * v3_cpu_mode_to_str(v3_vm_cpu_mode_t mode) { } } -v3_vm_mem_mode_t v3_get_mem_mode(struct guest_info * info) { +v3_mem_mode_t v3_get_vm_mem_mode(struct guest_info * info) { struct cr0_32 * cr0; if (info->shdw_pg_mode == SHADOW_PAGING) { @@ -140,7 +143,7 @@ v3_vm_mem_mode_t v3_get_mem_mode(struct guest_info * info) { static const uchar_t PHYS_MEM_STR[] = "Physical Memory"; static const uchar_t VIRT_MEM_STR[] = "Virtual Memory"; -const uchar_t * v3_mem_mode_to_str(v3_vm_mem_mode_t mode) { +const uchar_t * v3_mem_mode_to_str(v3_mem_mode_t mode) { switch (mode) { case PHYSICAL_MEM: return PHYS_MEM_STR;