From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Amsden Subject: Re: [PATCH] KVM: pit: Do not check pending pit timer in vcpu thread Date: Mon, 30 Aug 2010 11:33:33 -1000 Message-ID: <4C7C23AD.3090907@redhat.com> References: <20100827091506.10369.58066.stgit@FreeLancer> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, avi@redhat.com, kvm , Chris Lalancette To: Jason Wang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:13913 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756078Ab0H3Vdg (ORCPT ); Mon, 30 Aug 2010 17:33:36 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7ULXaPo005532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Aug 2010 17:33:36 -0400 In-Reply-To: <20100827091506.10369.58066.stgit@FreeLancer> Sender: kvm-owner@vger.kernel.org List-ID: On 08/26/2010 11:15 PM, Jason Wang wrote: > Pit interrupt injection was done by workqueue, so no need to check > pending pit timer in vcpu thread which could lead unnecessary > unblocking of vcpu. > Is this actually correct? There were a bunch of workarounds and fixes put into this code over time. Please check with Chris Lalancette, I think he was the last to touch this code. > Signed-off-by: Jason Wang > --- > arch/x86/kvm/i8254.c | 9 --------- > arch/x86/kvm/irq.c | 7 +------ > 2 files changed, 1 insertions(+), 15 deletions(-) > > diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c > index ddeb231..2ad40a4 100644 > --- a/arch/x86/kvm/i8254.c > +++ b/arch/x86/kvm/i8254.c > @@ -232,15 +232,6 @@ static void pit_latch_status(struct kvm *kvm, int channel) > } > } > > -int pit_has_pending_timer(struct kvm_vcpu *vcpu) > -{ > - struct kvm_pit *pit = vcpu->kvm->arch.vpit; > - > - if (pit&& kvm_vcpu_is_bsp(vcpu)&& pit->pit_state.irq_ack) > - return atomic_read(&pit->pit_state.pit_timer.pending); > - return 0; > -} > - > static void kvm_pit_ack_irq(struct kvm_irq_ack_notifier *kian) > { > struct kvm_kpit_state *ps = container_of(kian, struct kvm_kpit_state, > diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c > index 2095a04..f994da4 100644 > --- a/arch/x86/kvm/irq.c > +++ b/arch/x86/kvm/irq.c > @@ -33,12 +33,7 @@ > */ > int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) > { > - int ret; > - > - ret = pit_has_pending_timer(vcpu); > - ret |= apic_has_pending_timer(vcpu); > - > - return ret; > + return apic_has_pending_timer(vcpu); > } > EXPORT_SYMBOL(kvm_cpu_has_pending_timer); > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >