Skip to content

Commit

Permalink
KVM: x86 emulator: support byte/word opcode pairs
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Avi Kivity committed Oct 24, 2010
1 parent 081bca0 commit 8d8f4e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,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
};
Expand Down Expand Up @@ -2572,6 +2575,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;
Expand Down

0 comments on commit 8d8f4e9

Please sign in to comment.