X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_assist.c;h=d59ed0d23721957c1404c8a5cd7b37c9683e2293;hb=9cf8f2ddcb1d8c1d14adb6e5ac7084a5bb91d07a;hp=f926c42851717ff9c3c2421a8a6d3e77ebf19daf;hpb=5bf6d0c260240e314876a2fca8e3fd56bd6a1029;p=palacios.git diff --git a/palacios/src/palacios/vmx_assist.c b/palacios/src/palacios/vmx_assist.c index f926c42..d59ed0d 100644 --- a/palacios/src/palacios/vmx_assist.c +++ b/palacios/src/palacios/vmx_assist.c @@ -22,6 +22,11 @@ #include #include +#ifndef CONFIG_DEBUG_VMX +#undef PrintDebug +#define PrintDebug(fmt, args...) +#endif + static void vmx_save_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx); static void vmx_restore_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx); @@ -33,7 +38,7 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) { - if (guest_pa_to_host_va(info, VMXASSIST_BASE, (addr_t *)&hdr) == -1) { + if (v3_gpa_to_hva(info, VMXASSIST_BASE, (addr_t *)&hdr) == -1) { PrintError("Could not translate address for vmxassist header\n"); return -1; } @@ -44,17 +49,17 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) { } - if (guest_pa_to_host_va(info, (addr_t)(hdr->old_ctx_gpa), (addr_t *)&(old_ctx)) == -1) { + if (v3_gpa_to_hva(info, (addr_t)(hdr->old_ctx_gpa), (addr_t *)&(old_ctx)) == -1) { PrintError("Could not translate address for VMXASSIST old context\n"); return -1; } - if (guest_pa_to_host_va(info, (addr_t)(hdr->new_ctx_gpa), (addr_t *)&(new_ctx)) == -1) { + if (v3_gpa_to_hva(info, (addr_t)(hdr->new_ctx_gpa), (addr_t *)&(new_ctx)) == -1) { PrintError("Could not translate address for VMXASSIST new context\n"); return -1; } - if (vmx_info->state == VMXASSIST_DISABLED) { + if (vmx_info->assist_state == VMXASSIST_DISABLED) { /* Save the old Context */ vmx_save_world_ctx(info, old_ctx); @@ -62,13 +67,13 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) { /* restore new context, vmxassist should launch the bios the first time */ vmx_restore_world_ctx(info, new_ctx); - vmx_info->state = VMXASSIST_ENABLED; + vmx_info->assist_state = VMXASSIST_ENABLED; - } else if (vmx_info->state == VMXASSIST_ENABLED) { + } else if (vmx_info->assist_state == VMXASSIST_ENABLED) { /* restore old context */ vmx_restore_world_ctx(info, old_ctx); - vmx_info->state = VMXASSIST_DISABLED; + vmx_info->assist_state = VMXASSIST_DISABLED; } return 0; @@ -105,7 +110,7 @@ static void load_segment(struct vmx_assist_segment * vmx_assist_seg, struct v3_s static void vmx_save_world_ctx(struct guest_info * info, struct vmx_assist_context * ctx) { struct vmx_data * vmx_info = (struct vmx_data *)(info->vmm_data); - PrintDebug("Writing from RIP: 0x%p\n", (void *)info->rip); + PrintDebug("Writing from RIP: 0x%p\n", (void *)(addr_t)info->rip); ctx->eip = info->rip; ctx->esp = info->vm_regs.rsp;