X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_emulator.c;h=859d6b283d8bb70340618e8e69e8ab943ba31e1b;hb=e0519b6111165e0d99987d7f852875366c41bfd9;hp=2870ba05ffdd4df0771d9a85272f2fb52df85697;hpb=c9dc7207b3bd4ccfcc185798415eddfdd09ae641;p=palacios.git diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index 2870ba0..859d6b2 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -44,7 +44,7 @@ static int emulate_string_write_op(struct guest_info * info, struct x86_instr * addr_t src_addr = 0; if (dec_instr->op_type == V3_OP_MOVS) { - PrintError("MOVS emulation\n"); + // PrintError("MOVS emulation\n"); if (dec_instr->dst_operand.operand != write_gva) { PrintError("Inconsistency between Pagefault and Instruction Decode XED_ADDR=%p, PF_ADDR=%p\n", @@ -93,16 +93,17 @@ static int emulate_string_write_op(struct guest_info * info, struct x86_instr * if (dec_instr->dst_operand.size == 1) { - movs8((addr_t *)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); + movs8((addr_t *)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); } else if (dec_instr->dst_operand.size == 2) { - movs16((addr_t *)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); + movs16((addr_t *)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); } else if (dec_instr->dst_operand.size == 4) { - movs32((addr_t*)dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); + movs32((addr_t*)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(info->ctrl_regs.rflags)); } else { PrintError("Invalid operand length\n"); return -1; } + PrintDebug("Calling Write function\n"); if (write_fn(write_gpa, (void *)dst_addr, emulation_length, priv_data) != emulation_length) { PrintError("Did not fully read hooked data\n"); @@ -212,7 +213,7 @@ int v3_emulate_write_op(struct guest_info * info, addr_t write_gva, addr_t write } if (write_fn(write_gpa, (void *)dst_addr, op_len, priv_data) != op_len) { - PrintError("Did not fully read hooked data\n"); + PrintError("Did not fully write hooked data\n"); return -1; } @@ -232,7 +233,7 @@ int v3_emulate_read_op(struct guest_info * info, addr_t read_gva, addr_t read_gp int op_len = 0; PrintDebug("Emulating Read for instruction at %p\n", (void *)(addr_t)(info->rip)); - PrintDebug("GVA=%p\n", (void *)write_gva); + PrintDebug("GVA=%p\n", (void *)read_gva); if (info->mem_mode == PHYSICAL_MEM) { ret = read_guest_pa_memory(info, get_addr_linear(info, info->rip, &(info->segments.cs)), 15, instr);