Revision d73cd8f4

b/kvm-all.c
831 831
        fprintf(stderr, "emulation failure\n");
832 832
        if (!kvm_arch_stop_on_emulation_error(env)) {
833 833
            cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
834
            return 0;
834
            return EXCP_INTERRUPT;
835 835
        }
836 836
    }
837 837
    /* FIXME: Should trigger a qmp message to let management know
......
931 931
        if (run_ret < 0) {
932 932
            if (run_ret == -EINTR || run_ret == -EAGAIN) {
933 933
                DPRINTF("io window exit\n");
934
                ret = 0;
934
                ret = EXCP_INTERRUPT;
935 935
                break;
936 936
            }
937 937
            DPRINTF("kvm run failed %s\n", strerror(-run_ret));
938 938
            abort();
939 939
        }
940 940

  
941
        ret = 0; /* exit loop */
942 941
        switch (run->exit_reason) {
943 942
        case KVM_EXIT_IO:
944 943
            DPRINTF("handle_io\n");
......
947 946
                          run->io.direction,
948 947
                          run->io.size,
949 948
                          run->io.count);
950
            ret = 1;
949
            ret = 0;
951 950
            break;
952 951
        case KVM_EXIT_MMIO:
953 952
            DPRINTF("handle_mmio\n");
......
955 954
                                   run->mmio.data,
956 955
                                   run->mmio.len,
957 956
                                   run->mmio.is_write);
958
            ret = 1;
957
            ret = 0;
959 958
            break;
960 959
        case KVM_EXIT_IRQ_WINDOW_OPEN:
961 960
            DPRINTF("irq_window_open\n");
961
            ret = EXCP_INTERRUPT;
962 962
            break;
963 963
        case KVM_EXIT_SHUTDOWN:
964 964
            DPRINTF("shutdown\n");
965 965
            qemu_system_reset_request();
966
            ret = EXCP_INTERRUPT;
966 967
            break;
967 968
        case KVM_EXIT_UNKNOWN:
968 969
            fprintf(stderr, "KVM: unknown exit, hardware reason %" PRIx64 "\n",
......
979 980
            DPRINTF("kvm_exit_debug\n");
980 981
            if (kvm_arch_debug(&run->debug.arch)) {
981 982
                ret = EXCP_DEBUG;
982
                goto out;
983
                break;
983 984
            }
984 985
            /* re-enter, this exception was guest-internal */
985
            ret = 1;
986
            ret = 0;
986 987
            break;
987 988
#endif /* KVM_CAP_SET_GUEST_DEBUG */
988 989
        default:
989 990
            DPRINTF("kvm_arch_handle_exit\n");
990 991
            ret = kvm_arch_handle_exit(env, run);
992
            if (ret == 0) {
993
                ret = EXCP_INTERRUPT;
994
            } else if (ret > 0) {
995
                ret = 0;
996
            }
991 997
            break;
992 998
        }
993
    } while (ret > 0);
999
    } while (ret == 0);
994 1000

  
995 1001
    if (ret < 0) {
996 1002
        cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
997 1003
        vm_stop(VMSTOP_PANIC);
998 1004
    }
999
    ret = EXCP_INTERRUPT;
1000 1005

  
1001
#ifdef KVM_CAP_SET_GUEST_DEBUG
1002
out:
1003
#endif
1004 1006
    env->exit_request = 0;
1005 1007
    cpu_single_env = NULL;
1006 1008
    return ret;

Also available in: Unified diff