]> git.hungrycats.org Git - linux/commitdiff
KVM: PIT: fix i8254 pending count read
authorMarcelo Tosatti <mtosatti@redhat.com>
Mon, 23 Mar 2009 20:51:35 +0000 (17:51 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:57:11 +0000 (10:57 -0700)
(cherry picked from d2a8284e8fca9e2a938bee6cd074064d23864886)

count_load_time assignment is bogus: its supposed to contain what it
means, not the expiration time.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/i8254.c

index 59ebd37ad79e25b658217e02dd5b57ab38f18c21..3a104144a4543743ef0c5e93fd351f2ca501f67b 100644 (file)
@@ -207,7 +207,7 @@ static int __pit_timer_fn(struct kvm_kpit_state *ps)
        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);
 }