All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: [PATCH 1/8] KVM: x86 emulator: support byte/word opcode pairs
Date: Mon, 23 Aug 2010 14:06:10 +0300	[thread overview]
Message-ID: <1282561577-24491-2-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1282561577-24491-1-git-send-email-avi@redhat.com>

Many x86 instructions come in byte and word variants distinguished with bit
0 of the opcode.  Add macros to aid in defining them.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/emulate.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 3b35e13..152654e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2315,6 +2315,9 @@ static int em_rdtsc(struct x86_emulate_ctxt *ctxt)
 #define GD(_f, _g) { .flags = ((_f) | Group | GroupDual), .u.gdual = (_g) }
 #define I(_f, _e) { .flags = (_f), .u.execute = (_e) }
 
+#define D2bv(_f)      D((_f) | ByteOp), D(_f)
+#define I2bv(_f, _e)  I((_f) | ByteOp, _e), I(_f, _e)
+
 static struct opcode group1[] = {
 	X7(D(Lock)), N
 };
@@ -2557,6 +2560,9 @@ static struct opcode twobyte_table[256] = {
 #undef GD
 #undef I
 
+#undef D2bv
+#undef I2bv
+
 static unsigned imm_size(struct decode_cache *c)
 {
 	unsigned size;
-- 
1.7.1


  reply	other threads:[~2010-08-23 11:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 11:06 [PATCH 0/8] Simplify byte/word opcode pair decode Avi Kivity
2010-08-23 11:06 ` Avi Kivity [this message]
2010-08-23 11:06 ` [PATCH 2/8] KVM: x86 emulator: simplify ALU block (opcodes 00-3F) decode flags Avi Kivity
2010-08-25 19:39   ` Marcelo Tosatti
2010-08-26  8:26     ` Avi Kivity
2010-08-23 11:06 ` [PATCH 3/8] KVM: x86 emulator: simplify string instruction " Avi Kivity
2010-08-23 11:06 ` [PATCH 4/8] KVM: x86 emulator: simplify instruction decode flags for opcodes 80-8F Avi Kivity
2010-08-23 11:06 ` [PATCH 5/8] KVM: x86 emulator: simplify instruction decode flags for opcodes A0-AF Avi Kivity
2010-08-23 11:06 ` [PATCH 6/8] KVM: x86 emulator: simplify instruction decode flags for opcodes C0-DF Avi Kivity
2010-08-23 11:06 ` [PATCH 7/8] KVM: x86 emulator: simplify instruction decode flags for opcodes E0-FF Avi Kivity
2010-08-23 13:33   ` Gleb Natapov
2010-08-23 13:46     ` Avi Kivity
2010-08-23 13:56       ` Gleb Natapov
2010-08-23 11:06 ` [PATCH 8/8] KVM: x86 emulator: simplify instruction decode flags for opcodes 0F 00-FF Avi Kivity
2010-08-23 13:29 ` [PATCH 0/8] Simplify byte/word opcode pair decode Paolo Bonzini
2010-08-23 13:48   ` Avi Kivity
2010-08-23 14:04     ` Paolo Bonzini
2010-08-23 14:13       ` Avi Kivity

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=1282561577-24491-2-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@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 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.