* [PATCH] KVM: x86 emulator: fix handling for unemulated instructions
@ 2010-07-25 11:51 Avi Kivity
2010-07-27 21:33 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2010-07-25 11:51 UTC (permalink / raw)
To: Marcelo Tosatti, kvm, Mohammed Gamal
If an instruction is present in the decode tables but not in the execution
switch, it will be emulated as a NOP. An example is IRET (0xcf).
Fix by adding default: labels to the execution switches.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
arch/x86/kvm/emulate.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b38bd8b..a12512d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3029,6 +3029,8 @@ special_insn:
if (c->modrm_reg == 5)
goto jump_far;
goto grp45;
+ default:
+ goto cannot_emulate;
}
writeback:
@@ -3354,6 +3356,8 @@ twobyte_insn:
if (rc != X86EMUL_CONTINUE)
goto done;
break;
+ default:
+ goto cannot_emulate;
}
goto writeback;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-28 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-25 11:51 [PATCH] KVM: x86 emulator: fix handling for unemulated instructions Avi Kivity
2010-07-27 21:33 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox