X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_emulator.c;h=f80aade45891286c1e2148669c3d1add953587c1;hp=5fb922640c3d324a1117a6b0a1ea698ef889e7af;hb=46b8faf02be8ec628db5683bc6fdb55e72344c18;hpb=2b21111e5aec30a54f47383a11b179b0bd226463 diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index 5fb9226..f80aade 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -48,8 +48,11 @@ static int emulate_string_write_op(struct guest_info * info, struct x86_instr * return -1; } - emulation_length = ( (dec_instr->str_op_length < (0x1000 - PAGE_OFFSET_4KB(write_gva))) ? + /*emulation_length = ( (dec_instr->str_op_length < (0x1000 - PAGE_OFFSET_4KB(write_gva))) ? dec_instr->str_op_length : + (0x1000 - PAGE_OFFSET_4KB(write_gva)));*/ + emulation_length = ( (dec_instr->str_op_length * (dec_instr->dst_operand.size) < (0x1000 - PAGE_OFFSET_4KB(write_gva))) ? + dec_instr->str_op_length * dec_instr->dst_operand.size : (0x1000 - PAGE_OFFSET_4KB(write_gva))); /* ** Fix emulation length so that it doesn't overrun over the src page either ** */