From: Avi Kivity <[email protected]>

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 748ba1f..dd126a1 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2148,7 +2148,7 @@ static struct opcode opcode_table[256] = {
        D(DstMem | SrcNone | ModRM | Mov), D(ModRM | DstReg),
        D(ImplicitOps | SrcMem16 | ModRM), G(0, group1A),
        /* 0x90 - 0x97 */
-       X8(D(DstReg)),
+       X8(D(SrcAcc | DstReg)),
        /* 0x98 - 0x9F */
        N, N, D(SrcImmFAddr | No64), N,
        D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
@@ -2933,16 +2933,9 @@ special_insn:
                if (rc != X86EMUL_CONTINUE)
                        goto done;
                break;
-       case 0x90: /* nop / xchg r8,rax */
-               if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX]) {
-                       c->dst.type = OP_NONE;  /* nop */
-                       break;
-               }
-       case 0x91 ... 0x97: /* xchg reg,rax */
-               c->src.type = OP_REG;
-               c->src.bytes = c->op_bytes;
-               c->src.addr.reg = &c->regs[VCPU_REGS_RAX];
-               c->src.val = *(c->src.addr.reg);
+       case 0x90 ... 0x97: /* nop / xchg reg, rax */
+               if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
+                       goto done;
                goto xchg;
        case 0x9c: /* pushf */
                c->src.val =  (unsigned long) ctxt->eflags;
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to