#include <palacios/vmm_paging.h>
#include <palacios/vmm_instr_emulator.h>
-#ifndef DEBUG_EMULATOR
+#ifndef CONFIG_DEBUG_EMULATOR
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
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 ** */