KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failure
authorGleb Natapov <gleb@redhat.com>
Wed, 28 Apr 2010 16:15:35 +0000 (19:15 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:35:33 +0000 (10:35 +0300)
commit56cb18c9ac1ad11ba3643272a083fa4e41c0b771
treed6867ce238cb63a0c8ec69eb7752073569687025
parent5ae86f00fdc68660b08c29ecca839e305225631b
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>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/x86.c