KVM: PIT: fix i8254 pending count read
authorMarcelo Tosatti <mtosatti@redhat.com>
Tue, 30 Dec 2008 17:55:05 +0000 (15:55 -0200)
committerAvi Kivity <avi@redhat.com>
Sun, 15 Feb 2009 00:47:36 +0000 (02:47 +0200)
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>
arch/x86/kvm/i8254.c

index e665d1c623ca04f45444daf5324e6c6d6477612d..72bd275a9b5cee632b393448e325f371610f860b 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);
 }