X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_emulator.c;h=15a56d6030b3b34df4e58c05ce5c0e5fb01c9ffb;hb=481925dd42fdf715897007abbc32d81bda2d2586;hp=e5cf1f21efe7f95d0975c5566473813453dbd0c5;hpb=0a4bd37f65c15fe50680e51b68f3f95ec8d347ea;p=palacios.git diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index e5cf1f2..15a56d6 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -313,6 +313,10 @@ static int run_str_op(struct guest_info * core, struct x86_instr * instr, int emulation_length = op_size * rep_cnt; struct rflags * flags_reg = (struct rflags *)&(core->ctrl_regs.rflags); + + PrintError("Emulation_len=%d, tmp_rcx=%d\n", emulation_length, (uint_t)tmp_rcx); + + if (instr->op_type == V3_OP_MOVS) { if (op_size== 1) { movs8((addr_t *)&dst_addr, &src_addr, &tmp_rcx, (addr_t *)&(core->ctrl_regs.rflags)); @@ -358,6 +362,8 @@ static int run_str_op(struct guest_info * core, struct x86_instr * instr, return -1; } + + if (flags_reg->df == 0) { core->vm_regs.rdi += emulation_length; } else { @@ -383,8 +389,7 @@ int v3_emulate(struct guest_info * core, struct x86_instr * instr, addr_t src_hva = 0; addr_t dst_hva = 0; - - PrintError("USING THE NEW EMULATOR\n"); + if (instr->src_operand.type == MEM_OPERAND) { src_hva = mem_hva_src; @@ -393,7 +398,7 @@ int v3_emulate(struct guest_info * core, struct x86_instr * instr, } else { src_hva = (addr_t)&(instr->src_operand.operand); } - + if (instr->dst_operand.type == MEM_OPERAND) { dst_hva = mem_hva_dst; } else if (instr->dst_operand.type == REG_OPERAND) { @@ -401,7 +406,7 @@ int v3_emulate(struct guest_info * core, struct x86_instr * instr, } else { dst_hva = (addr_t)&(instr->dst_operand.operand); } - + if (instr->is_str_op == 0) { int src_op_len = instr->src_operand.size; @@ -421,6 +426,5 @@ int v3_emulate(struct guest_info * core, struct x86_instr * instr, } - return -1; }