From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 1/2] KVM: PIT: fix i8254 pending count read Date: Tue, 30 Dec 2008 15:55:05 -0200 Message-ID: <20081230175534.705028782@localhost.localdomain> References: <20081230175504.218547087@localhost.localdomain> Cc: avi@redhat.com, sheng@linux.intel.com, Marcelo Tosatti To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59948 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbYL3SCF (ORCPT ); Tue, 30 Dec 2008 13:02:05 -0500 Content-Disposition: inline; filename=i8254-fix-count Sender: kvm-owner@vger.kernel.org List-ID: count_load_time assignment is bogus: its supposed to contain what it means, not the expiration time. Signed-off-by: Marcelo Tosatti Index: kvm/arch/x86/kvm/i8254.c =================================================================== --- kvm.orig/arch/x86/kvm/i8254.c +++ kvm/arch/x86/kvm/i8254.c @@ -207,7 +207,7 @@ static int __pit_timer_fn(struct kvm_kpi hrtimer_add_expires_ns(&pt->timer, pt->period); pt->scheduled = hrtimer_get_expires_ns(&pt->timer); if (pt->period) - ps->channels[0].count_load_time = hrtimer_get_expires(&pt->timer); + ps->channels[0].count_load_time = ktime_get(); return (pt->period == 0 ? 0 : 1); } --