KVM: x86 emulator: do not open code return values from the emulator
authorGleb Natapov <gleb@redhat.com>
Mon, 28 Mar 2011 14:57:49 +0000 (16:57 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 11 May 2011 11:57:03 +0000 (07:57 -0400)
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index d88dcfd66a8f3b2081102f6cf7454cb249de280f..ae5f49105c3b1b607f6cc4b3447318ae7f63eb15 100644 (file)
@@ -2287,7 +2287,7 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
                        ctxt->eip = c->eip;
        }
 
-       return (rc == X86EMUL_UNHANDLEABLE) ? -1 : 0;
+       return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
 }
 
 static void string_addr_inc(struct x86_emulate_ctxt *ctxt, unsigned seg,
@@ -3333,7 +3333,7 @@ done_prefixes:
        }
 
 done:
-       return (rc == X86EMUL_UNHANDLEABLE) ? -1 : 0;
+       return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
 }
 
 static bool string_insn_completed(struct x86_emulate_ctxt *ctxt)
@@ -4163,5 +4163,5 @@ twobyte_insn:
        goto writeback;
 
 cannot_emulate:
-       return -1;
+       return EMULATION_FAILED;
 }