Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215751
b: refs/heads/master
c: 6142914
h: refs/heads/master
i:
  215749: 50b38df
  215747: 3a6f625
  215743: 9b782c4
v: v3
  • Loading branch information
Avi Kivity committed Oct 24, 2010
1 parent 960d986 commit 7ece299
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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: d46164dbd936bc11c7d2abed62f05b31c7a79ae7
refs/heads/master: 61429142802b068609ffd8ef48d891e05eeea0b9
15 changes: 14 additions & 1 deletion trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,18 @@ static int em_imul_3op(struct x86_emulate_ctxt *ctxt)
return em_imul(ctxt);
}

static int em_cwd(struct x86_emulate_ctxt *ctxt)
{
struct decode_cache *c = &ctxt->decode;

c->dst.type = OP_REG;
c->dst.bytes = c->src.bytes;
c->dst.addr.reg = &c->regs[VCPU_REGS_RDX];
c->dst.val = ~((c->src.val >> (c->src.bytes * 8 - 1)) - 1);

return X86EMUL_CONTINUE;
}

static int em_rdtsc(struct x86_emulate_ctxt *ctxt)
{
unsigned cpl = ctxt->ops->cpl(ctxt->vcpu);
Expand Down Expand Up @@ -2425,7 +2437,8 @@ static struct opcode opcode_table[256] = {
/* 0x90 - 0x97 */
X8(D(SrcAcc | DstReg)),
/* 0x98 - 0x9F */
D(DstAcc | SrcNone), N, D(SrcImmFAddr | No64), N,
D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd),
D(SrcImmFAddr | No64), N,
D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
/* 0xA0 - 0xA7 */
D(ByteOp | DstAcc | SrcMem | Mov | MemAbs), D(DstAcc | SrcMem | Mov | MemAbs),
Expand Down

0 comments on commit 7ece299

Please sign in to comment.