[Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2015-12-24 Thread Andrey Smetanin
Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page drops HV_X64_MSR_TIME_REF_COUNT msr reads count to zero which potentially improves performance. The patch ap

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-11 Thread Andrey Smetanin
ping On 12/24/2015 12:33 PM, Andrey Smetanin wrote: Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page drops HV_X64_MSR_TIME_REF_COUNT msr reads count to zero

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-18 Thread Denis V. Lunev
On 12/24/2015 12:33 PM, Andrey Smetanin wrote: Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page drops HV_X64_MSR_TIME_REF_COUNT msr reads count to zero whic

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Paolo Bonzini
On 19/01/2016 08:48, Denis V. Lunev wrote: >> >> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h >> index 6877b4d7e..93c9e25 100644 >> --- a/include/linux/kvm_host.h >> +++ b/include/linux/kvm_host.h >> @@ -145,6 +145,7 @@ static inline bool is_error_page(struct page *page) >>

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Denis V. Lunev
On 01/20/2016 05:05 PM, Paolo Bonzini wrote: On 19/01/2016 08:48, Denis V. Lunev wrote: diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 6877b4d7e..93c9e25 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -145,6 +145,7 @@ static inline bool is_error_

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Denis V. Lunev
On 01/20/2016 05:52 PM, Roman Kagan wrote: On Wed, Jan 20, 2016 at 05:44:49PM +0300, Denis V. Lunev wrote: On 01/20/2016 05:05 PM, Paolo Bonzini wrote: On 19/01/2016 08:48, Denis V. Lunev wrote: diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 6877b4d7e..93c9e25 100644 --

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Andrey Smetanin
On 01/20/2016 05:05 PM, Paolo Bonzini wrote: On 19/01/2016 08:48, Denis V. Lunev wrote: diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 6877b4d7e..93c9e25 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -145,6 +145,7 @@ static inline bool is_er

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Roman Kagan
On Wed, Jan 20, 2016 at 05:44:49PM +0300, Denis V. Lunev wrote: > On 01/20/2016 05:05 PM, Paolo Bonzini wrote: > > > >On 19/01/2016 08:48, Denis V. Lunev wrote: > >>>diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > >>>index 6877b4d7e..93c9e25 100644 > >>>--- a/include/linux/kvm_ho

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-20 Thread Paolo Bonzini
On 20/01/2016 15:52, Roman Kagan wrote: > I think Paolo wanted to be compatible not only with the de facto > implementation in Windows Hyper-V guests, but also with the Linux driver > which followed the buggy spec and thought 0x to be invalid. 0x is not invalid; it means it is va

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Paolo Bonzini
On 24/12/2015 10:33, Andrey Smetanin wrote: > Lately tsc page was implemented but filled with empty > values. This patch setup tsc page scale and offset based > on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. > > The valid tsc page drops HV_X64_MSR_TIME_REF_COUNT msr > reads count to

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 01:08 PM, Paolo Bonzini wrote: On 24/12/2015 10:33, Andrey Smetanin wrote: Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page drops HV_X64_

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Paolo Bonzini
On 22/01/2016 11:15, Andrey Smetanin wrote: >> >> - unless KVM can use a master clock, it is incorrect to set up the TSC >> page this way; the sequence needs to be 0x in that case > 0x is not an invalid value for tsc page, > see https://lkml.org/lkml/2015/11/2/655 oh, I see now.

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 02:02 PM, Paolo Bonzini wrote: On 22/01/2016 11:15, Andrey Smetanin wrote: - unless KVM can use a master clock, it is incorrect to set up the TSC page this way; the sequence needs to be 0x in that case 0x is not an invalid value for tsc page, see https://lkml.

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 02:02 PM, Paolo Bonzini wrote: On 22/01/2016 11:15, Andrey Smetanin wrote: - unless KVM can use a master clock, it is incorrect to set up the TSC page this way; the sequence needs to be 0x in that case 0x is not an invalid value for tsc page, see https://lkml.

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Paolo Bonzini
On 22/01/2016 12:31, Andrey Smetanin wrote: >> >> Sometimes the TSC is detected to be unstable and Linux switches to >> another clocksource. At least in that case you can get a write to the >> TSC page while the guest is running. > Sorry, now I got it, you mean host TSC is unstable and we should

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 02:53 PM, Paolo Bonzini wrote: On 22/01/2016 12:31, Andrey Smetanin wrote: Sometimes the TSC is detected to be unstable and Linux switches to another clocksource. At least in that case you can get a write to the TSC page while the guest is running. Sorry, now I got it, you m

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 01:08 PM, Paolo Bonzini wrote: On 24/12/2015 10:33, Andrey Smetanin wrote: Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page drops HV_X64_

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Paolo Bonzini
On 22/01/2016 14:13, Andrey Smetanin wrote: >> > > We(@virtuozzo.com) will be very thankful to you for the patch which > integrates Hyper-V tsc page with kvm clock. We even may do work by > yourself, but our priority now is Hyper-V VMBus initialization > (which is not in dependency on Hyper-V ts

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-22 Thread Andrey Smetanin
On 01/22/2016 04:21 PM, Paolo Bonzini wrote: On 22/01/2016 14:13, Andrey Smetanin wrote: We(@virtuozzo.com) will be very thankful to you for the patch which integrates Hyper-V tsc page with kvm clock. We even may do work by yourself, but our priority now is Hyper-V VMBus initialization (w

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-05 Thread Peter Hornyack
On Thu, Dec 24, 2015 at 1:33 AM, Andrey Smetanin wrote: > Lately tsc page was implemented but filled with empty > values. This patch setup tsc page scale and offset based > on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. > > The valid tsc page drops HV_X64_MSR_TIME_REF_COUNT msr > reads

Re: [Qemu-devel] [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-06 Thread Andrey Smetanin
On 01/06/2016 12:48 AM, Peter Hornyack wrote: On Thu, Dec 24, 2015 at 1:33 AM, Andrey Smetanin wrote: Lately tsc page was implemented but filled with empty values. This patch setup tsc page scale and offset based on vcpu tsc, tsc_khz and HV_X64_MSR_TIME_REF_COUNT value. The valid tsc page d