Avi Kivity wrote: > Zhang, Xiantao wrote: >> Before Aps going to block status, it should make sure SIGINT is >> masked, otherwise, it may eat SIGINT from user killing the guest, and >> results in Qemu hanging there, becasue main thread can't get it to >> free guest's resource. >> > >> vcpu_load(vcpu); >> >> + if (vcpu->sigset_active) >> + sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); + >> if (unlikely(vcpu->arch.mp_state == KVM_MP_STATE_UNINITIALIZED)) { >> kvm_vcpu_block(vcpu); >> clear_bit(KVM_REQ_UNHALT, &vcpu->requests); >> @@ -680,9 +683,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu >> *vcpu, struct kvm_run *kvm_run) return -EAGAIN; >> > > The 'return' here means you are returning with the wrong signal mask. Yes, but the signal is eaten by the thread, and can't be delivered to main thread when returing to usespace. So in order to ensure the main thread receive the signal SIGINT we should mask this signal on Aps going into halt, and only main thread can receive such signals. >> } >> >> - if (vcpu->sigset_active) >> - sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); - >> if (vcpu->mmio_needed) { >> memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8); >> kvm_set_mmio_data(vcpu); -- To unsubscribe from this list: send the line "unsubscribe kvm-ia64" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html