From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Thu, 23 Oct 2008 04:31:29 +0000 Subject: Re: [PATCH] kvm/ia64: Ensure SIGINT delivered to main thread (vcpu Message-Id: <48FFFE21.9010305@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: > 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. >>> >>> >>> diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c >>> index a40223f..9929c6f 100644 >>> --- a/arch/ia64/kvm/kvm-ia64.c >>> +++ b/arch/ia64/kvm/kvm-ia64.c >>> @@ -439,7 +439,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) >>> expires = div64_u64(itc_diff, cyc_per_usec); >>> kt = ktime_set(0, 1000 * expires); >>> >>> - down_read(&vcpu->kvm->slots_lock); >>> vcpu->arch.ht_active = 1; >>> hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS); >>> >>> @@ -452,7 +451,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) >>> if (vcpu->arch.mp_state = KVM_MP_STATE_HALTED) >>> vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; >>> - up_read(&vcpu->kvm->slots_lock); >>> >>> if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE) return >>> -EINTR; >>> >>> >> These bits appear unrelated? >> > There is nothing to be proteced by this lock here. If the vcpus go to halt with taking this lock, once other ones want to acquire write lock, they have to wait until all halted vcpus are waken up. > Very well; please send this as a separate patch. -- 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: Thu, 23 Oct 2008 06:31:29 +0200 Message-ID: <48FFFE21.9010305@redhat.com> References: <42DFA526FC41B1429CE7279EF83C6BDC01B489F8@pdsmsx415.ccr.corp.intel.com> <48FC3204.4030902@redhat.com> <42DFA526FC41B1429CE7279EF83C6BDC01B48ADD@pdsmsx415.ccr.corp.intel.com> <48FC44B5.4010206@redhat.com> <42DFA526FC41B1429CE7279EF83C6BDC01B97F9E@pdsmsx415.ccr.corp.intel.com> <48FF04AC.7060406@redhat.com> <706158FABBBA044BAD4FE898A02E4BC208473A40@pdsmsx503.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]:50370 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbYJWEbX (ORCPT ); Thu, 23 Oct 2008 00:31:23 -0400 In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC208473A40@pdsmsx503.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Zhang, Xiantao wrote: > 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. >>> >>> >>> diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c >>> index a40223f..9929c6f 100644 >>> --- a/arch/ia64/kvm/kvm-ia64.c >>> +++ b/arch/ia64/kvm/kvm-ia64.c >>> @@ -439,7 +439,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) >>> expires = div64_u64(itc_diff, cyc_per_usec); >>> kt = ktime_set(0, 1000 * expires); >>> >>> - down_read(&vcpu->kvm->slots_lock); >>> vcpu->arch.ht_active = 1; >>> hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS); >>> >>> @@ -452,7 +451,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) >>> if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED) >>> vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; >>> - up_read(&vcpu->kvm->slots_lock); >>> >>> if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE) return >>> -EINTR; >>> >>> >> These bits appear unrelated? >> > There is nothing to be proteced by this lock here. If the vcpus go to halt with taking this lock, once other ones want to acquire write lock, they have to wait until all halted vcpus are waken up. > Very well; please send this as a separate patch. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.