X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_ctrl_regs.c;h=bbeaf4ceb54650315d27194748721c89bd8ca51b;hb=be31ae90ff05da4b33a8389b6814f094a7385cd9;hp=9ed9102dc74af745ea3c077de02a31f4279e4fc9;hpb=b54cbe1dbbe15ed228de7472ea284df96ecce909;p=palacios.git diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index 9ed9102..bbeaf4c 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -141,6 +141,8 @@ static int handle_mov_to_cr0(struct guest_info * info, struct x86_instr * dec_in return -1; } } else { + + shadow_cr0->wp = 1; if (v3_activate_passthrough_pt(info) == -1) { PrintError("Failed to activate passthrough page tables\n"); @@ -320,14 +322,33 @@ int v3_handle_cr3_write(struct guest_info * info) { struct cr3_32 * guest_cr3 = (struct cr3_32 *)&(info->shdw_pg_state.guest_cr3); *guest_cr3 = *new_cr3; } + + +#ifdef CONFIG_CRAY_XT // If Paging is enabled in the guest then we need to change the shadow page tables if (info->mem_mode == VIRTUAL_MEM) { + if (info->shdw_pg_state.prev_guest_cr3 != info->shdw_pg_state.guest_cr3) { + if (v3_activate_shadow_pt(info) == -1) { + PrintError("Failed to activate 32 bit shadow page table\n"); + return -1; + } + } + } + + info->shdw_pg_state.prev_guest_cr3 = info->shdw_pg_state.guest_cr3; +#else + + // If Paging is enabled in the guest then we need to change the shadow page tables + if (info->mem_mode == VIRTUAL_MEM) { if (v3_activate_shadow_pt(info) == -1) { PrintError("Failed to activate 32 bit shadow page table\n"); return -1; } } + +#endif + PrintDebug("New Shadow CR3=%p; New Guest CR3=%p\n", (void *)(addr_t)(info->ctrl_regs.cr3), @@ -545,7 +566,6 @@ int v3_handle_efer_read(uint_t msr, struct v3_msr * dst, void * priv_data) { dst->value = info->shdw_pg_state.guest_efer.value; - info->rip += 2; // WRMSR/RDMSR are two byte operands return 0; } @@ -569,7 +589,5 @@ int v3_handle_efer_write(uint_t msr, struct v3_msr src, void * priv_data) { // Enable/Disable Syscall shadow_efer->sce = src.value & 0x1; - info->rip += 2; // WRMSR/RDMSR are two byte operands - return 0; }