KVM: x86 emulator: Fix nop emulation
authorMohammed Gamal <m.gamal005@gmail.com>
Wed, 4 Aug 2010 11:41:04 +0000 (14:41 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:50:41 +0000 (10:50 +0200)
If a nop instruction is encountered, we jump directly to the done label.
This skip updating rip. Break from the switch case instead

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index 955d48074648a2db5562dcea4f02c5d3cc18c8db..ddbad15c94867921b662e025c7da32d73e39269e 100644 (file)
@@ -2912,7 +2912,7 @@ special_insn:
                break;
        case 0x90 ... 0x97: /* nop / xchg reg, rax */
                if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
-                       goto done;
+                       break;
                goto xchg;
        case 0x9c: /* pushf */
                c->src.val =  (unsigned long) ctxt->eflags;