aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2007-08-28 21:08:37 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:28 -0400
commitf6eed39135c03d39ff4095b1ddd947672469dfee (patch)
treece01911db566551519c1c23036b1d19e46928080 /drivers/kvm
parent7d316911632acb8ba8cb7c1dd318ba723c9f1d50 (diff)
KVM: x86 emulator: call near
Implement emulation of instruction opcode: 0xe8 call (near) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/x86_emulate.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 4fc2da6aae7d..9f1772fd7480 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -150,7 +150,7 @@ static u8 opcode_table[256] = {
150 /* 0xE0 - 0xE7 */ 150 /* 0xE0 - 0xE7 */
151 0, 0, 0, 0, 0, 0, 0, 0, 151 0, 0, 0, 0, 0, 0, 0, 0,
152 /* 0xE8 - 0xEF */ 152 /* 0xE8 - 0xEF */
153 0, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 0, 0, 0, 153 ImplicitOps, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 0, 0, 0,
154 /* 0xF0 - 0xF7 */ 154 /* 0xF0 - 0xF7 */
155 0, 0, 0, 0, 155 0, 0, 0, 0,
156 ImplicitOps, 0, 156 ImplicitOps, 0,
@@ -1033,6 +1033,26 @@ push:
1033 case 0xd2 ... 0xd3: /* Grp2 */ 1033 case 0xd2 ... 0xd3: /* Grp2 */
1034 src.val = _regs[VCPU_REGS_RCX]; 1034 src.val = _regs[VCPU_REGS_RCX];
1035 goto grp2; 1035 goto grp2;
1036 case 0xe8: /* call (near) */ {
1037 long int rel;
1038 switch (op_bytes) {
1039 case 2:
1040 rel = insn_fetch(s16, 2, _eip);
1041 break;
1042 case 4:
1043 rel = insn_fetch(s32, 4, _eip);
1044 break;
1045 case 8:
1046 rel = insn_fetch(s64, 8, _eip);
1047 break;
1048 default:
1049 DPRINTF("Call: Invalid op_bytes\n");
1050 goto cannot_emulate;
1051 }
1052 src.val = (unsigned long) _eip;
1053 JMP_REL(rel);
1054 goto push;
1055 }
1036 case 0xe9: /* jmp rel */ 1056 case 0xe9: /* jmp rel */
1037 case 0xeb: /* jmp rel short */ 1057 case 0xeb: /* jmp rel short */
1038 JMP_REL(src.val); 1058 JMP_REL(src.val);