public inbox for kvm@vger.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 08/13] KVM: x86 emulator: Make group storage bits separate from operand bits
Date: Mon, 26 Jul 2010 14:37:46 +0300	[thread overview]
Message-ID: <1280144271-328-9-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1280144271-328-1-git-send-email-avi@redhat.com>

Currently group bits are stored in bits 0:7, where operand bits are stored.

Make group bits be 0:3, and move the existing bits 0:3 to 16:19, so we can
mix group and operand bits.

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

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index efed4db..434ac8f 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -46,15 +46,15 @@
  */
 
 /* Operand sizes: 8-bit operands or specified/overridden size. */
-#define ByteOp      (1<<0)	/* 8-bit operands. */
+#define ByteOp      (1<<16)	/* 8-bit operands. */
 /* Destination operand type. */
-#define ImplicitOps (1<<1)	/* Implicit in opcode. No generic decode. */
-#define DstReg      (2<<1)	/* Register operand. */
-#define DstMem      (3<<1)	/* Memory operand. */
-#define DstAcc      (4<<1)      /* Destination Accumulator */
-#define DstDI       (5<<1)	/* Destination is in ES:(E)DI */
-#define DstMem64    (6<<1)	/* 64bit memory operand */
-#define DstMask     (7<<1)
+#define ImplicitOps (1<<17)	/* Implicit in opcode. No generic decode. */
+#define DstReg      (2<<17)	/* Register operand. */
+#define DstMem      (3<<17)	/* Memory operand. */
+#define DstAcc      (4<<17)	/* Destination Accumulator */
+#define DstDI       (5<<17)	/* Destination is in ES:(E)DI */
+#define DstMem64    (6<<17)	/* 64bit memory operand */
+#define DstMask     (7<<17)
 /* Source operand type. */
 #define SrcNone     (0<<4)	/* No source operand. */
 #define SrcImplicit (0<<4)	/* Source operand is implicit in the opcode. */
@@ -82,7 +82,7 @@
 #define Stack       (1<<13)     /* Stack instruction (push/pop) */
 #define Group       (1<<14)     /* Bits 3:5 of modrm byte extend opcode */
 #define GroupDual   (1<<15)     /* Alternate decoding of mod == 3 */
-#define GroupMask   0xff        /* Group number stored in bits 0:7 */
+#define GroupMask   0x0f        /* Group number stored in bits 0:3 */
 /* Misc flags */
 #define Lock        (1<<26) /* lock prefix is allowed for the instruction */
 #define Priv        (1<<27) /* instruction generates #GP if current CPL != 0 */
-- 
1.7.1


  parent reply	other threads:[~2010-07-26 11:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 11:37 [PATCH 00/13] Emulator group simplification Avi Kivity
2010-07-26 11:37 ` [PATCH 01/13] KVM: x86 emulator: add macros for repetitive instructions Avi Kivity
2010-07-26 11:37 ` [PATCH 02/13] KVM: x86 emulator: consolidate inc/dec reg decoding Avi Kivity
2010-07-26 11:37 ` [PATCH 03/13] KVM: x86 emulator: consolidate push/pop " Avi Kivity
2010-07-26 11:37 ` [PATCH 04/13] KVM: X86 emulator: consolidate Jcc rel8 decoding Avi Kivity
2010-07-26 11:37 ` [PATCH 05/13] KVM: x86 emulator: consolidate MOV reg, imm decoding Avi Kivity
2010-07-26 11:37 ` [PATCH 06/13] KVM: x86 emulator: consolidate CMOVcc decoding Avi Kivity
2010-07-26 11:37 ` [PATCH 07/13] KVM: x86 emulator: consolidate Jcc rel32 decoding Avi Kivity
2010-07-26 11:37 ` Avi Kivity [this message]
2010-07-26 11:37 ` [PATCH 09/13] KVM: x86 emulator: add Undefined decode flag Avi Kivity
2010-07-26 11:37 ` [PATCH 10/13] KVM: x86 emulator: mix decode bits from opcode and group decode tables Avi Kivity
2010-07-26 11:37 ` [PATCH 11/13] KVM: x86 emulator: simplify Group 1 decoding Avi Kivity
2010-07-26 11:37 ` [PATCH 12/13] KVM: x86 emulator: Allow LOCK prefix for NEG and NOT Avi Kivity
2010-07-26 11:37 ` [PATCH 13/13] KVM: x86 emulator: unify the two Group 3 variants Avi Kivity
2010-07-27 23:21 ` [PATCH 00/13] Emulator group simplification Marcelo Tosatti

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=1280144271-328-9-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox