From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel@lists.sourceforge.net,
Mohammed Gamal <m.gamal005@gmail.com>,
Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Subject: Re: Protected mode transitions and big real mode... still an issue
Date: Thu, 15 May 2008 10:33:38 +0300 [thread overview]
Message-ID: <482BE752.4080405@qumranet.com> (raw)
In-Reply-To: <20080514212953.GA17705@dmt>
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.
But register-in-modrm decoding is a mess, yes. I think the best thing
is to have decode_modrm() accept a struct operand parameter and decode
into that.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
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/
next prev parent reply other threads:[~2008-05-15 7:33 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 13:02 Protected mode transitions and big real mode... still an issue Guillaume Thouvenin
2008-04-29 16:41 ` Anthony Liguori
2008-04-29 17:09 ` Laurent Vivier
2008-04-29 17:22 ` Laurent Vivier
2008-04-29 23:20 ` Avi Kivity
2008-04-29 18:17 ` Anthony Liguori
2008-04-29 16:56 ` David Mair
2008-04-29 18:16 ` Anthony Liguori
2008-05-01 19:13 ` Marcelo Tosatti
2008-05-03 8:26 ` Balaji Rao
2008-05-05 12:40 ` Guillaume Thouvenin
2008-05-05 12:44 ` Balaji Rao
2008-05-05 12:57 ` Anthony Liguori
2008-05-05 13:29 ` Mohammed Gamal
2008-05-06 13:38 ` Guillaume Thouvenin
2008-05-06 14:30 ` Anthony Liguori
2008-05-06 17:05 ` Mohammed Gamal
2008-05-14 7:29 ` Guillaume Thouvenin
2008-05-14 21:29 ` Marcelo Tosatti
2008-05-15 7:33 ` Avi Kivity [this message]
2008-05-15 7:49 ` Guillaume Thouvenin
2008-05-15 18:07 ` Mohammed Gamal
2008-05-07 5:57 ` Guillaume Thouvenin
2008-05-05 6:27 ` Guillaume Thouvenin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=482BE752.4080405@qumranet.com \
--to=avi@qumranet.com \
--cc=guillaume.thouvenin@ext.bull.net \
--cc=kvm-devel@lists.sourceforge.net \
--cc=m.gamal005@gmail.com \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.