Skip to content

Commit 55bebde

Browse files
Nitin A Kambleavikivity
authored andcommitted
KVM: X86 emulator: jump conditional short
Implement emulation of more jump conditional instructions jcc shortrel opcodes: 0x70 - 0x7f Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
1 parent bbe9abb commit 55bebde

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/kvm/x86_emulate.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ static u8 opcode_table[256] = {
111111
0, 0, ImplicitOps|Mov, 0,
112112
SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, /* insb, insw/insd */
113113
SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, /* outsb, outsw/outsd */
114-
/* 0x70 - 0x7F */
115-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
114+
/* 0x70 - 0x77 */
115+
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
116+
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
117+
/* 0x78 - 0x7F */
118+
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
119+
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
116120
/* 0x80 - 0x87 */
117121
ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM,
118122
ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM,
@@ -1268,6 +1272,13 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
12681272
) == 0)
12691273
return -1;
12701274
return 0;
1275+
case 0x70 ... 0x7f: /* jcc (short) */ {
1276+
int rel = insn_fetch(s8, 1, _eip);
1277+
1278+
if (test_cc(b, _eflags))
1279+
JMP_REL(rel);
1280+
break;
1281+
}
12711282
case 0x9c: /* pushf */
12721283
src.val = (unsigned long) _eflags;
12731284
goto push;

0 commit comments

Comments
 (0)