KVM: x86 emulator: push imm8
authorNitin A Kamble <nitin.a.kamble@intel.com>
Wed, 29 Aug 2007 00:58:52 +0000 (17:58 -0700)
committerAvi Kivity <avi@qumranet.com>
Sat, 13 Oct 2007 08:18:28 +0000 (10:18 +0200)
Implement the instruction

     push imm8
     opcode: 0x6a

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/x86_emulate.c

index 86171ca794dd826e242ab5e75d6546c252758dba..4fc2da6aae7d65fe785b208d9da8cc5ef44c8e85 100644 (file)
@@ -104,10 +104,11 @@ static u8 opcode_table[256] = {
        /* 0x58 - 0x5F */
        ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
        ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
-       /* 0x60 - 0x6B */
+       /* 0x60 - 0x67 */
        0, 0, 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ ,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       /* 0x6C - 0x6F */
+       0, 0, 0, 0,
+       /* 0x68 - 0x6F */
+       0, 0, ImplicitOps|Mov, 0,
        SrcNone  | ByteOp  | ImplicitOps, SrcNone  | ImplicitOps, /* insb, insw/insd */
        SrcNone  | ByteOp  | ImplicitOps, SrcNone  | ImplicitOps, /* outsb, outsw/outsd */
        /* 0x70 - 0x7F */
@@ -919,6 +920,16 @@ done_prefixes:
                        goto cannot_emulate;
                dst.val = (s32) src.val;
                break;
+       case 0x6a: /* push imm8 */
+               src.val = 0L;
+               src.val = insn_fetch(s8, 1, _eip);
+push:
+               dst.type  = OP_MEM;
+               dst.bytes = op_bytes;
+               dst.val = src.val;
+               register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
+               dst.ptr = register_address(ctxt->ss_base, _regs[VCPU_REGS_RSP]);
+               break;
        case 0x80 ... 0x83:     /* Grp1 */
                switch (modrm_reg) {
                case 0: