X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_ctrl_regs.c;h=6bbde364fcf7b29c04c18f55b0431b0dda9ba3a9;hb=1f9fa9cd9662a600f49a3b12fcc02fd2ffca93c8;hp=685de90e0341ae1853610748139c7116b6dfa6b4;hpb=7b93b104b5c8eee70e11304789b2a7d66cff9704;p=palacios.git diff --git a/palacios/src/palacios/vmx_ctrl_regs.c b/palacios/src/palacios/vmx_ctrl_regs.c index 685de90..6bbde36 100644 --- a/palacios/src/palacios/vmx_ctrl_regs.c +++ b/palacios/src/palacios/vmx_ctrl_regs.c @@ -27,7 +27,7 @@ #include #include -#ifndef CONFIG_DEBUG_VMX +#ifndef V3_CONFIG_DEBUG_VMX #undef PrintDebug #define PrintDebug(fmt, args...) #endif @@ -192,7 +192,7 @@ static int handle_mov_to_cr0(struct guest_info * info, v3_reg_t * new_cr0, struc guest_cr0->pg = 1; guest_cr0->ne = 1; - if (paging_transition) { + if ((paging_transition)) { // Paging transition if (v3_get_vm_mem_mode(info) == VIRTUAL_MEM) { @@ -209,14 +209,24 @@ static int handle_mov_to_cr0(struct guest_info * info, v3_reg_t * new_cr0, struc // PrintDebug("Activating Shadow Page tables\n"); - if (v3_activate_shadow_pt(info) == -1) { - PrintError("Failed to activate shadow page tables\n"); - return -1; + if (info->shdw_pg_mode == SHADOW_PAGING) { + if (v3_activate_shadow_pt(info) == -1) { + PrintError("Failed to activate shadow page tables\n"); + return -1; + } } - } else if (v3_activate_passthrough_pt(info) == -1) { - PrintError("Failed to activate passthrough page tables\n"); - return -1; + } else { + + if (info->shdw_pg_mode == SHADOW_PAGING) { + if (v3_activate_passthrough_pt(info) == -1) { + PrintError("Failed to activate passthrough page tables\n"); + return -1; + } + } else { + // This is hideous... Let's hope that the 1to1 page table has not been nuked... + info->ctrl_regs.cr3 = VMXASSIST_1to1_PT; + } } } }