lkml.org 
[lkml]   [2017]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8] KVM: LAPIC: Apply change to TDCR right away to the timer
2017-10-06 16:51+0200, Paolo Bonzini:
> On 06/10/2017 16:38, Wanpeng Li wrote:
> > + now = ktime_get();
> > + remaining = ktime_sub(apic->lapic_timer.target_expiration, now);
>
> Still need to compare against zero here. I guess Radim can do it.

I added the expression from v7 while applying, thanks.

if (ktime_to_ns(remaining) < 0)
remaining = 0;

> > + ns_remaining_old = ktime_to_ns(remaining);
> > + ns_remaining_new = mul_u64_u32_div(ns_remaining_old,
> > + apic->divide_count, old_divisor);
> > +
> > + apic->lapic_timer.tscdeadline += nsec_to_cycles(apic->vcpu, ns_remaining_new) -
> > + nsec_to_cycles(apic->vcpu, ns_remaining_old);
> > + apic->lapic_timer.target_expiration = ktime_add_ns(now, ns_remaining_new);

\
 
 \ /
  Last update: 2017-10-06 17:02    [W:0.051 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site