On 28/11/2016 15:28, Eduardo Habkost wrote:
> > +    s->src_use_reliable_get_clock = data.flags & KVM_CLOCK_TSC_STABLE;
> 
> I still don't understand the reasoning behind
> kvm_has_adjust_clock_stable() vs (flags & KVM_CLOCK_TSC_STABLE),
> but on either case, updating src_use_reliable_get_clock inside
> kvm_get_clock() looks like the right thing to do.

There are three possibility: the kernel tells you the clock is stable,
the kernel tells you the clock is unstable, the kernel is too old and
doesn't tell you anything.  Then:

    kvm_has_adjust_clock_stable() == true:
        if the clock is stable, KVM_CLOCK_TSC_STABLE will be set in "flags"
        if the clock is unstable, KVM_CLOCK_TSC_STABLE will be unset

    kvm_has_adjust_clock_stable() == false:
        you cannot know if the clock is stable

Paolo

Reply via email to