From: Mohammed Gamal Subject: [PATCH] x86 emulator: Fix nop emulation Date: Wed, 4 Aug 2010 14:41:04 +0300 Message-ID: <1280922064-5078-1-git-send-email-m.gamal005@gmail.com> Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Mohammed Gamal To: avi@redhat.com Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:46910 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932655Ab0HDLl0 (ORCPT ); Wed, 4 Aug 2010 07:41:26 -0400 Received: by wyb39 with SMTP id 39so5404761wyb.19 for ; Wed, 04 Aug 2010 04:41:25 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/emulate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e4e2b20..f0f4a43 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2975,7 +2975,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; -- 1.7.0.4