From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Mon, 20 Oct 2008 07:23:48 +0000 Subject: Re: [PATCH] kvm/ia64: Ensure SIGINT delivered to main thread (vcpu Message-Id: <48FC3204.4030902@redhat.com> List-Id: References: <42DFA526FC41B1429CE7279EF83C6BDC01B489F8@pdsmsx415.ccr.corp.intel.com> In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDC01B489F8@pdsmsx415.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ia64@vger.kernel.org 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. > } > > - 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); > -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm/ia64: Ensure SIGINT delivered to main thread (vcpu 0). Date: Mon, 20 Oct 2008 09:23:48 +0200 Message-ID: <48FC3204.4030902@redhat.com> References: <42DFA526FC41B1429CE7279EF83C6BDC01B489F8@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-ia64@vger.kernel.org, kvm@vger.kernel.org To: "Zhang, Xiantao" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33215 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbYJTHXm (ORCPT ); Mon, 20 Oct 2008 03:23:42 -0400 In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDC01B489F8@pdsmsx415.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > } > > - 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); > -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.