From patchwork Mon Jul 6 01:55:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 34297 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66K1WPC005491 for ; Mon, 6 Jul 2009 20:01:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753676AbZGFUB2 (ORCPT ); Mon, 6 Jul 2009 16:01:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753952AbZGFUB2 (ORCPT ); Mon, 6 Jul 2009 16:01:28 -0400 Received: from mx2.redhat.com ([66.187.237.31]:39622 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbZGFUBX (ORCPT ); Mon, 6 Jul 2009 16:01:23 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n66K1RQW013651 for ; Mon, 6 Jul 2009 16:01:27 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n66K1Qwa028813; Mon, 6 Jul 2009 16:01:26 -0400 Received: from amt.cnet (vpn-51-10.sfbay.redhat.com [10.14.51.10]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n66K1PPp030090; Mon, 6 Jul 2009 16:01:25 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id A5AD3274CF4; Mon, 6 Jul 2009 17:00:53 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n66K0qfx008096; Mon, 6 Jul 2009 17:00:52 -0300 Message-Id: <20090706015813.109958204@localhost.localdomain> References: <20090706015511.923596553@localhost.localdomain> User-Agent: quilt/0.46-1 Date: Sun, 05 Jul 2009 22:55:18 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 7/8] KVM: PIT: removed unused code Content-Disposition: inline; filename=kvm-cleanup-pit X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Marcelo Tosatti Index: kvm-new/arch/x86/kvm/i8254.c =================================================================== --- kvm-new.orig/arch/x86/kvm/i8254.c +++ kvm-new/arch/x86/kvm/i8254.c @@ -228,10 +228,7 @@ static void kvm_pit_ack_irq(struct kvm_i { struct kvm_kpit_state *ps = container_of(kian, struct kvm_kpit_state, irq_ack_notifier); - spin_lock(&ps->inject_lock); kvm_timer_ack(&ps->pit_timer); - ps->irq_ack = 1; - spin_unlock(&ps->inject_lock); } static void destroy_pit_timer(struct kvm_timer *pt) @@ -252,7 +249,6 @@ static void create_pit_timer(struct kvm_ /* TODO The new value only affected after the retriggered */ kvm_timer_cancel(pt); - ps->irq_ack = 1; kvm_timer_start(pt, interval, is_period); } @@ -516,17 +512,14 @@ static void kvm_pit_reset(struct kvm_pit mutex_unlock(&pit->pit_state.lock); kvm_timer_reset(&pit->pit_state.pit_timer); - pit->pit_state.irq_ack = 1; } static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask) { struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier); - if (!mask) { + if (!mask) kvm_timer_reset(&pit->pit_state.pit_timer); - pit->pit_state.irq_ack = 1; - } } static const struct kvm_io_device_ops pit_dev_ops = { @@ -587,7 +580,6 @@ struct kvm_pit *kvm_create_pit(struct kv mutex_init(&pit->pit_state.lock); mutex_lock(&pit->pit_state.lock); - spin_lock_init(&pit->pit_state.inject_lock); kvm->arch.vpit = pit; pit->kvm = kvm; Index: kvm-new/arch/x86/kvm/i8254.h =================================================================== --- kvm-new.orig/arch/x86/kvm/i8254.h +++ kvm-new/arch/x86/kvm/i8254.h @@ -25,8 +25,6 @@ struct kvm_kpit_state { u32 speaker_data_on; struct mutex lock; struct kvm_pit *pit; - spinlock_t inject_lock; - unsigned long irq_ack; struct kvm_irq_ack_notifier irq_ack_notifier; };