From bb4ea39329d6c3de4c10034621781f703d095699 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 15 Mar 2011 12:26:28 +0100 Subject: 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 CC: Alexander Graf Signed-off-by: Marcelo Tosatti --- target-i386/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'target-i386') diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 032bc3e1a..6f8461079 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; -- cgit v1.2.3