Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103715
b: refs/heads/master
c: 954cd36
h: refs/heads/master
i:
  103713: 6718008
  103711: ee32b20
v: v3
  • Loading branch information
Guillaume Thouvenin authored and Avi Kivity committed Jul 20, 2008
1 parent 9db252f commit 66a73ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 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: 89c696383d6eb493351a89d450d8ad7a55cbe1da
refs/heads/master: 954cd36f7613ac6d084abe33114dd45a8e0dbe92
31 changes: 29 additions & 2 deletions trunk/arch/x86/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ static u16 opcode_table[256] = {
/* 0xE0 - 0xE7 */
0, 0, 0, 0, 0, 0, 0, 0,
/* 0xE8 - 0xEF */
ImplicitOps | Stack, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps,
ImplicitOps | Stack, SrcImm | ImplicitOps,
ImplicitOps, SrcImmByte | ImplicitOps,
0, 0, 0, 0,
/* 0xF0 - 0xF7 */
0, 0, 0, 0,
Expand Down Expand Up @@ -1661,7 +1662,33 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
break;
}
case 0xe9: /* jmp rel */
case 0xeb: /* jmp rel short */
goto jmp;
case 0xea: /* jmp far */ {
uint32_t eip;
uint16_t sel;

switch (c->op_bytes) {
case 2:
eip = insn_fetch(u16, 2, c->eip);
break;
case 4:
eip = insn_fetch(u32, 4, c->eip);
break;
default:
DPRINTF("jmp far: Invalid op_bytes\n");
goto cannot_emulate;
}
sel = insn_fetch(u16, 2, c->eip);
if (kvm_load_segment_descriptor(ctxt->vcpu, sel, 9, VCPU_SREG_CS) < 0) {
DPRINTF("jmp far: Failed to load CS descriptor\n");
goto cannot_emulate;
}

c->eip = eip;
break;
}
case 0xeb:
jmp: /* jmp rel short */
jmp_rel(c, c->src.val);
c->dst.type = OP_NONE; /* Disable writeback. */
break;
Expand Down

0 comments on commit 66a73ed

Please sign in to comment.