public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_emulate: Emulate nop (0x90) instruction
@ 2008-06-14 11:50 Mohammed Gamal
  2008-06-14 13:26 ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammed Gamal @ 2008-06-14 11:50 UTC (permalink / raw)
  To: kvm; +Cc: avi, riel

While testing FreeDOS under KVM I encountered a vmentry failure
because of a nop instruction.
This patch adds the instruction to the x86 emulator.

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
 arch/x86/kvm/x86_emulate.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index b90857c..ef1b7d7 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -141,7 +141,7 @@ static u16 opcode_table[256] = {
 	DstMem | SrcReg | ModRM | Mov, ModRM | DstReg,
 	DstReg | SrcMem | ModRM | Mov, Group | Group1A,
 	/* 0x90 - 0x9F */
-	0, 0, 0, 0, 0, 0, 0, 0,
+	ImplicitOps, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, ImplicitOps | Stack, ImplicitOps | Stack, 0, 0,
 	/* 0xA0 - 0xA7 */
 	ByteOp | DstReg | SrcMem | Mov | MemAbs, DstReg | SrcMem | Mov | MemAbs,
@@ -1560,6 +1560,9 @@ special_insn:
 		if (rc != 0)
 			goto done;
 		break;
+	case 0x90: /* nop */
+		if(! (c->rex_prefix & 1) )
+			break;
 	case 0x9c: /* pushf */
 		c->src.val =  (unsigned long) ctxt->eflags;
 		emulate_push(ctxt);

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

end of thread, other threads:[~2008-06-14 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-14 11:50 [PATCH] x86_emulate: Emulate nop (0x90) instruction Mohammed Gamal
2008-06-14 13:26 ` Andi Kleen
2008-06-14 13:35   ` Mohammed Gamal
2008-06-14 15:08     ` Andi Kleen
2008-06-14 15:26       ` Avi Kivity

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