X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_ctrl_regs.c;h=7d59b82667bd41a5f42e90c0805f788a838329ef;hb=1c63b0651a5d039076d8027c7cd87960e4151408;hp=a05f1b9568e863e018cea3feb42ea76478bce860;hpb=639fdba00d36b2a60fad3d28703459354cf8744f;p=palacios.git diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index a05f1b9..7d59b82 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include @@ -106,7 +106,8 @@ int handle_cr0_write(struct guest_info * info) { } else if ((instr[index] == cr_access_byte) && (instr[index + 1] == clts_byte)) { // CLTS - + PrintDebug("CLTS unhandled\n"); + return -1; } else if ((instr[index] == cr_access_byte) && (instr[index + 1] = mov_to_cr_byte)) { @@ -291,13 +292,14 @@ int handle_cr0_read(struct guest_info * info) { if (guest_pa_to_host_va(info, first_operand + (info->segments.ds.base << 4), &host_addr) == -1) { // gpf the guest + PrintDebug("Could not convert guest physical address to host virtual address\n"); return -1; } first_operand = host_addr; } else { - // error... don't know what to do - return -1; + // Register operand + // Should be ok?? } cr0_val = *(char*)cr0 & 0x0f; @@ -448,6 +450,8 @@ int handle_cr3_write(struct guest_info * info) { struct cr3_32 * shadow_cr3 = (struct cr3_32 *)&(info->shdw_pg_state.shadow_cr3); struct cr3_32 * guest_cr3 = (struct cr3_32 *)&(info->shdw_pg_state.guest_cr3); + /* Delete the current Page Tables */ + delete_page_tables_pde32((pde32_t *)CR3_TO_PDE32(shadow_cr3)); *guest_cr3 = *new_cr3; @@ -455,6 +459,7 @@ int handle_cr3_write(struct guest_info * info) { shadow_pt = create_new_shadow_pt32(info); //shadow_pt = setup_shadow_pt32(info, CR3_TO_PDE32(*(addr_t *)new_cr3)); + /* Copy Various flags */ *shadow_cr3 = *new_cr3;