From: Paolo Bonzini <pbonzini@redhat.com>
To: Bandan Das <bsd@redhat.com>, kvm@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 3/6] KVM: emulate: cleanup decode_rm
Date: Sun, 13 Apr 2014 08:51:03 -0400 [thread overview]
Message-ID: <534A8837.8010308@redhat.com> (raw)
In-Reply-To: <1397174612-17373-4-git-send-email-bsd@redhat.com>
Il 10/04/2014 20:03, Bandan Das ha scritto:
> - if (ctxt->rex_prefix) {
> - ctxt->modrm_reg = (ctxt->rex_prefix & 4) << 1; /* REX.R */
> - index_reg = (ctxt->rex_prefix & 2) << 2; /* REX.X */
> - ctxt->modrm_rm = base_reg = (ctxt->rex_prefix & 1) << 3; /* REG.B */
> - }
> + index_reg = (ctxt->rex_prefix << 2) & 8; /* REX.X */
> + base_reg = (ctxt->rex_prefix << 3) & 8; /* REG.B */
This is REX.B (preexisting typo), and please leave REX.R here too for
clarity.
Also, the function is "decode_modrm", not "decode_rm" (in the commit
message).
Otherwise the series seems okay from a somewhat cursory review.
Paolo
>
> - ctxt->modrm_mod |= (ctxt->modrm & 0xc0) >> 6;
> - ctxt->modrm_reg |= (ctxt->modrm & 0x38) >> 3;
> - ctxt->modrm_rm |= (ctxt->modrm & 0x07);
> + ctxt->modrm_mod = (ctxt->modrm & 0xc0) >> 6;
> + ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8) | /* REX.R */
> + ((ctxt->modrm & 0x38) >> 3);
> + ctxt->modrm_rm = base_reg | (ctxt->modrm & 0x07);
> ctxt->modrm_seg = VCPU_SREG_DS;
>
next prev parent reply other threads:[~2014-04-13 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 0:03 [RFC PATCH v2 0/6] Emulator speedups - avoid initializations where possible Bandan Das
2014-04-11 0:03 ` [RFC PATCH v2 1/6] KVM: emulate: move init_decode_cache to emulate.c Bandan Das
2014-04-11 0:03 ` [RFC PATCH v2 2/6] KVM: emulate: Remove ctxt->intercept and ctxt->check_perm checks Bandan Das
2014-04-11 0:03 ` [RFC PATCH v2 3/6] KVM: emulate: cleanup decode_rm Bandan Das
2014-04-13 12:51 ` Paolo Bonzini [this message]
2014-04-11 0:03 ` [RFC PATCH v2 4/6] KVM: emulate: clean up initializations in init_decode_cache Bandan Das
2014-04-11 0:03 ` [RFC PATCH v2 5/6] KVM: emulate: rework seg_override Bandan Das
2014-04-11 0:03 ` [RFC PATCH v2 6/6] KVM: emulate: remove memopp and rip_relative Bandan Das
2014-04-13 12:48 ` Paolo Bonzini
2014-04-14 14:01 ` Bandan Das
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=534A8837.8010308@redhat.com \
--to=pbonzini@redhat.com \
--cc=bsd@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).