Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133706
b: refs/heads/master
c: 350f69d
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Mar 24, 2009
1 parent eda0159 commit 35a984f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10f32d84c750ccf8c0afb3a4ea9d4059aa3e9ffc
refs/heads/master: 350f69dcd169d536307aa4a8c38c480e3a51c0db
15 changes: 6 additions & 9 deletions trunk/arch/x86/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,18 +1136,19 @@ static inline void emulate_push(struct x86_emulate_ctxt *ctxt)
}

static int emulate_pop(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops)
struct x86_emulate_ops *ops,
void *dest, int len)
{
struct decode_cache *c = &ctxt->decode;
int rc;

rc = ops->read_emulated(register_address(c, ss_base(ctxt),
c->regs[VCPU_REGS_RSP]),
&c->src.val, c->src.bytes, ctxt->vcpu);
dest, len, ctxt->vcpu);
if (rc != 0)
return rc;

register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->src.bytes);
register_address_increment(c, &c->regs[VCPU_REGS_RSP], len);
return rc;
}

Expand All @@ -1157,11 +1158,9 @@ static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt,
struct decode_cache *c = &ctxt->decode;
int rc;

c->src.bytes = c->dst.bytes;
rc = emulate_pop(ctxt, ops);
rc = emulate_pop(ctxt, ops, &c->dst.val, c->dst.bytes);
if (rc != 0)
return rc;
c->dst.val = c->src.val;
return 0;
}

Expand Down Expand Up @@ -1467,11 +1466,9 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
break;
case 0x58 ... 0x5f: /* pop reg */
pop_instruction:
c->src.bytes = c->op_bytes;
rc = emulate_pop(ctxt, ops);
rc = emulate_pop(ctxt, ops, &c->dst.val, c->op_bytes);
if (rc != 0)
goto done;
c->dst.val = c->src.val;
break;
case 0x63: /* movsxd */
if (ctxt->mode != X86EMUL_MODE_PROT64)
Expand Down

0 comments on commit 35a984f

Please sign in to comment.