summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/kvm_emulate.h
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-04-28 20:15:35 +0400
committerAvi Kivity <avi@redhat.com>2010-08-01 11:35:33 +0400
commitc3cd7ffaf57ae6ead5b394cebaeb76164059a57f (patch)
treed6867ce238cb63a0c8ec69eb7752073569687025 /arch/x86/include/asm/kvm_emulate.h
parent411c35b7ef02aefb91e166ffeffad0891d955fcb (diff)
downloadlinux-c3cd7ffaf57ae6ead5b394cebaeb76164059a57f.tar.xz
KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failure
Currently emulator returns -1 when emulation failed or IO is needed. Caller tries to guess whether emulation failed by looking at other variables. Make it easier for caller to recognise error condition by always returning -1 in case of failure. For this new emulator internal return value X86EMUL_IO_NEEDED is introduced. It is used to distinguish between error condition (which returns X86EMUL_UNHANDLEABLE) and condition that requires IO exit to userspace to continue emulation. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 0cf4311db0d6..777240d4524e 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -53,6 +53,7 @@ struct x86_emulate_ctxt;
#define X86EMUL_PROPAGATE_FAULT 2 /* propagate a generated fault to guest */
#define X86EMUL_RETRY_INSTR 3 /* retry the instruction for some reason */
#define X86EMUL_CMPXCHG_FAILED 4 /* cmpxchg did not see expected value */
+#define X86EMUL_IO_NEEDED 5 /* IO is needed to complete emulation */
struct x86_emulate_ops {
/*