aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-03-15 12:26:28 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-16 17:11:06 -0300
commitbb4ea39329d6c3de4c10034621781f703d095699 (patch)
tree9627e9893b96c6b3aba7f804484a08e584309ff6 /target-i386/kvm.c
parentd73cd8f4ea1c2944bd16f7a1c445eaa25c9e6e26 (diff)
downloadqemu-bb4ea39329d6c3de4c10034621781f703d095699.zip
qemu-bb4ea39329d6c3de4c10034621781f703d095699.tar.gz
qemu-bb4ea39329d6c3de4c10034621781f703d095699.tar.bz2
kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes
Make the return code of kvm_arch_handle_exit directly usable for kvm_cpu_exec. This is straightforward for x86 and ppc, just s390 would require more work. Avoid this for now by pushing the return code translation logic into s390's kvm_arch_handle_exit. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> CC: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 032bc3e..6f84610 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1618,10 +1618,10 @@ static int kvm_handle_halt(CPUState *env)
(env->eflags & IF_MASK)) &&
!(env->interrupt_request & CPU_INTERRUPT_NMI)) {
env->halted = 1;
- return 0;
+ return EXCP_HLT;
}
- return 1;
+ return 0;
}
static bool host_supports_vmx(void)
@@ -1637,7 +1637,7 @@ static bool host_supports_vmx(void)
int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run)
{
uint64_t code;
- int ret = 0;
+ int ret;
switch (run->exit_reason) {
case KVM_EXIT_HLT:
@@ -1645,7 +1645,7 @@ int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run)
ret = kvm_handle_halt(env);
break;
case KVM_EXIT_SET_TPR:
- ret = 1;
+ ret = 0;
break;
case KVM_EXIT_FAIL_ENTRY:
code = run->fail_entry.hardware_entry_failure_reason;