Skip to contentSkip to conversation

x86 emulator: Fix nop emulation

PATCH Applied Mohammed Gamal 2 participants 2 messages Aug 4, 2010 – Aug 5, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86 emulator: Fix nop emulation

If a nop instruction is encountered, we jump directly to the done label. This skip updating rip. Break from the switch case instead

---
 arch/x86/kvm/emulate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/emulate.c +1 -1
index e4e2b20..f0f4a43 100644
@@ -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;
Signature · 1 line
1.7.0.4
Applied
#1 lore raw
Quoted 2 lines · 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

Applied, thanks. I was sloppy there.

Signature · 1 line
error compiling committee.c: too many arguments to function