On Thu, 15 May 2008 10:33:38 +0300 Avi Kivity <[EMAIL PROTECTED]> wrote:
> Marcelo Tosatti wrote: > > 1) add is storing the result in the wrong register > > > > 6486: 66 64 89 3e 72 01 mov %edi,%fs:0x172 > > 648c: 66 be 8d 03 00 00 mov $0x38d,%esi > > 6492: 66 c1 e6 04 shl $0x4,%esi > > 6496: 66 b8 98 0a 00 00 mov $0xa98,%eax > > 649c: 66 03 f0 add %eax,%esi > > > > The destination for the add is "%esi", but the emulation stores the > > result in eax, because: > > > > if ((c->d & ModRM) && c->modrm_mod == 3) { > > u8 reg; > > c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; > > c->dst.ptr = decode_register(c->modrm_rm, c->regs, > > c->d & ByteOp); > > } > > > > modrm_reg contains "6", which is the correct register index, but > > modrm_rm contains 0, so the result is stored in "eax" (see hack). > > > > What version are you looking at? Current code doesn't have exactly this. It's in my patch. I added this because in gfxboot code there is an instruction "add %eax, %esp" that needs to be emulated and with the normal path, if I remember well, we have c->dst.bytes == 0 and thus, the emulate_2op_SrcV() function just do nothing. Regards, Guillaume ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel