]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: x86 emulator: fix 'push imm8' emulation
authorAvi Kivity <avi@qumranet.com>
Fri, 26 Oct 2007 12:16:56 +0000 (14:16 +0200)
committerAvi Kivity <avi@qumranet.com>
Thu, 8 Nov 2007 08:42:04 +0000 (10:42 +0200)
'push imm8' found itself in the wrong switch somehow, so it is never executed.

This fixes Windows 2003 installation.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/x86_emulate.c

index a6ace302e0cd454f1f413306013b0920305e4a67..da0cdd521da9b3c545796877c505aaacd01b85d0 100644 (file)
@@ -980,17 +980,6 @@ 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 = (void *) register_address(ctxt->ss_base,
-                                                       _regs[VCPU_REGS_RSP]);
-               break;
        case 0x80 ... 0x83:     /* Grp1 */
                switch (modrm_reg) {
                case 0:
@@ -1243,6 +1232,17 @@ special_insn:
                register_address_increment(_regs[VCPU_REGS_RSP], op_bytes);
                no_wb = 1; /* Disable writeback. */
                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 = (void *) register_address(ctxt->ss_base,
+                                                       _regs[VCPU_REGS_RSP]);
+               break;
        case 0x6c:              /* insb */
        case 0x6d:              /* insw/insd */
                 if (kvm_emulate_pio_string(ctxt->vcpu, NULL,