Revision 9ccfac9e kvm-all.c

b/kvm-all.c
199 199
    return kvm_state->pit_in_kernel;
200 200
}
201 201

  
202

  
203 202
int kvm_init_vcpu(CPUState *env)
204 203
{
205 204
    KVMState *s = kvm_state;
......
896 895

  
897 896
    DPRINTF("kvm_cpu_exec()\n");
898 897

  
899
    do {
900
#ifndef CONFIG_IOTHREAD
901
        if (env->exit_request) {
902
            DPRINTF("interrupt exit requested\n");
903
            ret = 0;
904
            break;
905
        }
906
#endif
907

  
908
        if (kvm_arch_process_irqchip_events(env)) {
909
            ret = 0;
910
            break;
911
        }
898
    if (kvm_arch_process_irqchip_events(env)) {
899
        env->exit_request = 0;
900
        env->exception_index = EXCP_HLT;
901
        return 0;
902
    }
912 903

  
904
    do {
913 905
        if (env->kvm_vcpu_dirty) {
914 906
            kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE);
915 907
            env->kvm_vcpu_dirty = 0;
916 908
        }
917 909

  
918 910
        kvm_arch_pre_run(env, run);
911
        if (env->exit_request) {
912
            DPRINTF("interrupt exit requested\n");
913
            /*
914
             * KVM requires us to reenter the kernel after IO exits to complete
915
             * instruction emulation. This self-signal will ensure that we
916
             * leave ASAP again.
917
             */
918
            qemu_cpu_kick_self();
919
        }
919 920
        cpu_single_env = NULL;
920 921
        qemu_mutex_unlock_iothread();
922

  
921 923
        ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
924

  
922 925
        qemu_mutex_lock_iothread();
923 926
        cpu_single_env = env;
924 927
        kvm_arch_post_run(env, run);

Also available in: Unified diff