diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-04-12 06:36:36 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:41 -0400 |
commit | d53c4777b3a3e5031710d0664851d1309325884b (patch) | |
tree | 6cb774e790eff54c45e04844886b81a68005714a /arch/x86/kvm/x86_emulate.c | |
parent | b2833e3cdebfe3ea4d0d1d3ce4d2ff1c42a4f8f4 (diff) |
KVM: x86 emulator: Complete decoding of call near in decode stage
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86_emulate.c')
-rw-r--r-- | arch/x86/kvm/x86_emulate.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 14b8ee2c09e9..4a9cd4c2b983 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
@@ -192,7 +192,7 @@ static u32 opcode_table[256] = { | |||
192 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, | 192 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, |
193 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, | 193 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, |
194 | /* 0xE8 - 0xEF */ | 194 | /* 0xE8 - 0xEF */ |
195 | ImplicitOps | Stack, SrcImm | ImplicitOps, | 195 | SrcImm | Stack, SrcImm | ImplicitOps, |
196 | SrcImm | Src2Imm16, SrcImmByte | ImplicitOps, | 196 | SrcImm | Src2Imm16, SrcImmByte | ImplicitOps, |
197 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, | 197 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, |
198 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, | 198 | SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, |
@@ -1781,18 +1781,7 @@ special_insn: | |||
1781 | io_dir_in = 0; | 1781 | io_dir_in = 0; |
1782 | goto do_io; | 1782 | goto do_io; |
1783 | case 0xe8: /* call (near) */ { | 1783 | case 0xe8: /* call (near) */ { |
1784 | long int rel; | 1784 | long int rel = c->src.val; |
1785 | switch (c->op_bytes) { | ||
1786 | case 2: | ||
1787 | rel = insn_fetch(s16, 2, c->eip); | ||
1788 | break; | ||
1789 | case 4: | ||
1790 | rel = insn_fetch(s32, 4, c->eip); | ||
1791 | break; | ||
1792 | default: | ||
1793 | DPRINTF("Call: Invalid op_bytes\n"); | ||
1794 | goto cannot_emulate; | ||
1795 | } | ||
1796 | c->src.val = (unsigned long) c->eip; | 1785 | c->src.val = (unsigned long) c->eip; |
1797 | jmp_rel(c, rel); | 1786 | jmp_rel(c, rel); |
1798 | emulate_push(ctxt); | 1787 | emulate_push(ctxt); |