Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197642
b: refs/heads/master
c: e35b7b9
h: refs/heads/master
v: v3
  • Loading branch information
Gleb Natapov authored and Avi Kivity committed Apr 25, 2010
1 parent 5a48b2e commit d1659d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d49ec72d3fab0aa90510a64a973d594c48b1fd1
refs/heads/master: e35b7b9c9e7d8768ee34e5904fed4cb0f2c2cb5d
18 changes: 18 additions & 0 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
#define Src2ImmByte (2<<29)
#define Src2One (3<<29)
#define Src2Imm16 (4<<29)
#define Src2Mem16 (5<<29) /* Used for Ep encoding. First argument has to be
in memory and second argument is located
immediately after the first one in memory. */
#define Src2Mask (7<<29)

enum {
Expand Down Expand Up @@ -1163,6 +1166,10 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
c->src2.bytes = 1;
c->src2.val = 1;
break;
case Src2Mem16:
c->src2.bytes = 2;
c->src2.type = OP_MEM;
break;
}

/* Decode and fetch the destination operand: register or memory. */
Expand Down Expand Up @@ -1881,6 +1888,17 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
c->src.orig_val = c->src.val;
}

if (c->src2.type == OP_MEM) {
c->src2.ptr = (unsigned long *)(memop + c->src.bytes);
c->src2.val = 0;
rc = ops->read_emulated((unsigned long)c->src2.ptr,
&c->src2.val,
c->src2.bytes,
ctxt->vcpu);
if (rc != X86EMUL_CONTINUE)
goto done;
}

if ((c->d & DstMask) == ImplicitOps)
goto special_insn;

Expand Down

0 comments on commit d1659d5

Please sign in to comment.