diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2011-07-30 05:03:34 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 12:18:01 -0400 |
commit | 1d2887e2d849969f58ce79203f9785ebe065d494 (patch) | |
tree | 9ca6e1bfdf14e646b9816aa45a18230e1880784d /arch/x86/kvm/x86.c | |
parent | 7d88bb4803d62f6056b079ade6333a026fd11684 (diff) |
KVM: x86 emulator: Make x86_decode_insn() return proper macros
Return EMULATION_OK/FAILED consistently. Also treat instruction fetch
errors, not restricted to X86EMUL_UNHANDLEABLE, as EMULATION_FAILED;
although this cannot happen in practice, the current logic will continue
the emulation even if the decoder fails to fetch the instruction.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index d28dff749dfd..1fe9637ff153 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4837,7 +4837,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, | |||
4837 | 4837 | ||
4838 | trace_kvm_emulate_insn_start(vcpu); | 4838 | trace_kvm_emulate_insn_start(vcpu); |
4839 | ++vcpu->stat.insn_emulation; | 4839 | ++vcpu->stat.insn_emulation; |
4840 | if (r) { | 4840 | if (r != EMULATION_OK) { |
4841 | if (emulation_type & EMULTYPE_TRAP_UD) | 4841 | if (emulation_type & EMULTYPE_TRAP_UD) |
4842 | return EMULATE_FAIL; | 4842 | return EMULATE_FAIL; |
4843 | if (reexecute_instruction(vcpu, cr2)) | 4843 | if (reexecute_instruction(vcpu, cr2)) |