X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_emulator.c;h=82dc56c4e67ac24470d428cffadd08592bfa18a4;hb=50b2cfeb17c210c307b380fd90ae7e82c7d144ca;hp=2870ba05ffdd4df0771d9a85272f2fb52df85697;hpb=c9dc7207b3bd4ccfcc185798415eddfdd09ae641;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index 2870ba0..82dc56c 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -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);