From: Takuya Yoshikawa <takuya.yoshikawa@gmail.com>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp
Subject: Re: [PATCH 4/4] KVM: x86 emulator: Avoid pushing back ModRM byte in decode_opcode()
Date: Tue, 24 Apr 2012 23:27:36 +0900 [thread overview]
Message-ID: <20120424232736.91d7c5fe3ae27393ac41f36d@gmail.com> (raw)
In-Reply-To: <4F96B440.1030106@redhat.com>
On Tue, 24 Apr 2012 17:10:08 +0300
Avi Kivity <avi@redhat.com> wrote:
> > + if (!modrm_fetched && (ctxt->d & ModRM))
> > + ctxt->modrm = insn_fetch(u8, ctxt);
>
> Instead of adding yet another conditional, how about doing something like
>
> if ((c->d & ModRM) || (gtype == Group) || (gtype == GroupDual))
> ctxt->modrm = insn_fetch(u8, ctxt);
>
> somewhere early?
Looks nicer than mine.
> In fact even that is too much. All groups have ModRM somewhere in their
> encoding; all we have to do is move it to the main tables (opcode_table
> or twobyte_table) and just move the existing modrm fetch before group
> parsing.
I see.
Then, the best way to go seems to be drop patch-4 and work on the ModRM
fetch issue separately.
Modifying the tables needs some care.
Thanks,
Takuya
next prev parent reply other threads:[~2012-04-24 14:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 15:31 [PATCH 0/4] KVM: x86 emulator: Split decoder into separate functions Takuya Yoshikawa
2012-04-23 15:33 ` [PATCH 1/4] KVM: x86 emulator: Introduce ctxt->op_prefix for 0x66 prefix Takuya Yoshikawa
2012-04-23 15:34 ` [PATCH 2/4] KVM: x86 emulator: Make prefix decoding a separate function Takuya Yoshikawa
2012-04-23 15:35 ` [PATCH 3/4] KVM: x86 emulator: Make opcode " Takuya Yoshikawa
2012-04-23 15:37 ` [PATCH 4/4] KVM: x86 emulator: Avoid pushing back ModRM byte in decode_opcode() Takuya Yoshikawa
2012-04-24 14:10 ` Avi Kivity
2012-04-24 14:27 ` Takuya Yoshikawa [this message]
2012-04-24 14:11 ` [PATCH 0/4] KVM: x86 emulator: Split decoder into separate functions Avi Kivity
2012-04-24 14:41 ` Takuya Yoshikawa
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=20120424232736.91d7c5fe3ae27393ac41f36d@gmail.com \
--to=takuya.yoshikawa@gmail.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=yoshikawa.takuya@oss.ntt.co.jp \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox