public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 emulator: Fix nop emulation
@ 2010-08-04 11:41 Mohammed Gamal
  2010-08-05  8:03 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Mohammed Gamal @ 2010-08-04 11:41 UTC (permalink / raw)
  To: avi; +Cc: mtosatti, kvm, Mohammed Gamal

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-05  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-04 11:41 [PATCH] x86 emulator: Fix nop emulation Mohammed Gamal
2010-08-05  8:03 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox