]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: x86 emulator: consolidate push reg
authorGuillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Mon, 22 Sep 2008 14:08:06 +0000 (16:08 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:51:39 +0000 (16:51 +0200)
This patch consolidate the emulation of push reg instruction.

Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86_emulate.c

index ea051173b0da9e950ca92d6841a42c507e957444..a391e213fe612dd55fd23efd0aa4a0ebf3eac579 100644 (file)
@@ -1415,13 +1415,7 @@ special_insn:
                emulate_1op("dec", c->dst, ctxt->eflags);
                break;
        case 0x50 ... 0x57:  /* push reg */
-               c->dst.type  = OP_MEM;
-               c->dst.bytes = c->op_bytes;
-               c->dst.val = c->src.val;
-               register_address_increment(c, &c->regs[VCPU_REGS_RSP],
-                                          -c->op_bytes);
-               c->dst.ptr = (void *) register_address(
-                       c, ss_base(ctxt), c->regs[VCPU_REGS_RSP]);
+               emulate_push(ctxt);
                break;
        case 0x58 ... 0x5f: /* pop reg */
        pop_instruction: