Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-19 Thread Roman Kagan
On Mon, Sep 19, 2016 at 01:39:12PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-19 Thread Roman Kagan
On Mon, Sep 19, 2016 at 01:39:12PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

[PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-19 Thread Paolo Bonzini
Introduce a function that reads the exact nanoseconds value that is provided to the guest in kvmclock. This crystallizes the notion of kvmclock as a thin veneer over a stable TSC, that the guest will (hopefully) convert with NTP. In other words, kvmclock is *not* a paravirtualized host-to-guest

[PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-19 Thread Paolo Bonzini
Introduce a function that reads the exact nanoseconds value that is provided to the guest in kvmclock. This crystallizes the notion of kvmclock as a thin veneer over a stable TSC, that the guest will (hopefully) convert with NTP. In other words, kvmclock is *not* a paravirtualized host-to-guest

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-05 Thread Paolo Bonzini
On 02/09/2016 17:24, Roman Kagan wrote: > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: >> Introduce a function that reads the exact nanoseconds value that is >> provided to the guest in kvmclock. This crystallizes the notion of >> kvmclock as a thin veneer over a stable TSC,

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-05 Thread Paolo Bonzini
On 02/09/2016 17:24, Roman Kagan wrote: > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: >> Introduce a function that reads the exact nanoseconds value that is >> provided to the guest in kvmclock. This crystallizes the notion of >> kvmclock as a thin veneer over a stable TSC,

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-03 Thread Roman Kagan
On Fri, Sep 02, 2016 at 06:37:59PM +0200, Paolo Bonzini wrote: > > > On 02/09/2016 16:51, Roman Kagan wrote: > > On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: > >> On 02/09/2016 15:52, Roman Kagan wrote: > >> vs. using a single offset as in the TSC ref page is one

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-03 Thread Roman Kagan
On Fri, Sep 02, 2016 at 06:37:59PM +0200, Paolo Bonzini wrote: > > > On 02/09/2016 16:51, Roman Kagan wrote: > > On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: > >> On 02/09/2016 15:52, Roman Kagan wrote: > >> vs. using a single offset as in the TSC ref page is one

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Fri, Sep 02, 2016 at 06:57:10PM +0200, Paolo Bonzini wrote: > > > On 02/09/2016 18:55, Roman Kagan wrote: > >> > I'll change patch 4 to store the parameters and use them when accessing > >> > the time reference counter MSR. I'll still keep the procedure that goes > >> > through kvmclock.

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Fri, Sep 02, 2016 at 06:57:10PM +0200, Paolo Bonzini wrote: > > > On 02/09/2016 18:55, Roman Kagan wrote: > >> > I'll change patch 4 to store the parameters and use them when accessing > >> > the time reference counter MSR. I'll still keep the procedure that goes > >> > through kvmclock.

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 18:55, Roman Kagan wrote: >> > I'll change patch 4 to store the parameters and use them when accessing >> > the time reference counter MSR. I'll still keep the procedure that goes >> > through kvmclock. It's a bit more involved for the scale, but >> > vcpu->last_guest_tsc only

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 18:55, Roman Kagan wrote: >> > I'll change patch 4 to store the parameters and use them when accessing >> > the time reference counter MSR. I'll still keep the procedure that goes >> > through kvmclock. It's a bit more involved for the scale, but >> > vcpu->last_guest_tsc only

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 16:51, Roman Kagan wrote: > On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: >> On 02/09/2016 15:52, Roman Kagan wrote: >> vs. using a single offset as in the TSC ref page is one nanosecond---and >> the ref page only has a resolution of 100 ns. > > AFAICS it's not a

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 16:51, Roman Kagan wrote: > On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: >> On 02/09/2016 15:52, Roman Kagan wrote: >> vs. using a single offset as in the TSC ref page is one nanosecond---and >> the ref page only has a resolution of 100 ns. > > AFAICS it's not a

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: > On 02/09/2016 15:52, Roman Kagan wrote: > > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > >> --- a/arch/x86/kvm/hyperv.c > >> +++ b/arch/x86/kvm/hyperv.c > >> @@ -386,7 +386,7 @@ static void synic_init(struct

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Fri, Sep 02, 2016 at 04:09:42PM +0200, Paolo Bonzini wrote: > On 02/09/2016 15:52, Roman Kagan wrote: > > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > >> --- a/arch/x86/kvm/hyperv.c > >> +++ b/arch/x86/kvm/hyperv.c > >> @@ -386,7 +386,7 @@ static void synic_init(struct

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Roman Kagan
On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: > Introduce a function that reads the exact nanoseconds value that is > provided to the guest in kvmclock. This crystallizes the notion of > kvmclock as a thin veneer over a stable TSC, that the guest will > (hopefully) convert with

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 15:52, Roman Kagan wrote: > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: >> Introduce a function that reads the exact nanoseconds value that is >> provided to the guest in kvmclock. This crystallizes the notion of >> kvmclock as a thin veneer over a stable TSC,

Re: [PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-02 Thread Paolo Bonzini
On 02/09/2016 15:52, Roman Kagan wrote: > On Thu, Sep 01, 2016 at 05:26:14PM +0200, Paolo Bonzini wrote: >> Introduce a function that reads the exact nanoseconds value that is >> provided to the guest in kvmclock. This crystallizes the notion of >> kvmclock as a thin veneer over a stable TSC,

[PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-01 Thread Paolo Bonzini
Introduce a function that reads the exact nanoseconds value that is provided to the guest in kvmclock. This crystallizes the notion of kvmclock as a thin veneer over a stable TSC, that the guest will (hopefully) convert with NTP. In other words, kvmclock is *not* a paravirtualized host-to-guest

[PATCH 3/4] KVM: x86: introduce get_kvmclock_ns

2016-09-01 Thread Paolo Bonzini
Introduce a function that reads the exact nanoseconds value that is provided to the guest in kvmclock. This crystallizes the notion of kvmclock as a thin veneer over a stable TSC, that the guest will (hopefully) convert with NTP. In other words, kvmclock is *not* a paravirtualized host-to-guest