From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Subject: Re: [PATCH kvm-unit-tests] KVM: x86: add hyperv clock test case Date: Fri, 22 Apr 2016 16:32:40 +0300 Message-ID: <20160422133240.GA9108@rkaganb.sw.ru> References: <1453989899-30351-1-git-send-email-pbonzini@redhat.com> <20160128162206.GA29344@rkaganb.sw.ru> <56B22CB4.9090404@redhat.com> <20160421170157.GA16360@rkaganb.sw.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , "Denis V. Lunev" , Marcelo Tosatti To: Paolo Bonzini Return-path: Received: from mail-db3on0117.outbound.protection.outlook.com ([157.55.234.117]:10888 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752918AbcDVNr0 (ORCPT ); Fri, 22 Apr 2016 09:47:26 -0400 Content-Disposition: inline In-Reply-To: <20160421170157.GA16360@rkaganb.sw.ru> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 21, 2016 at 08:01:58PM +0300, Roman Kagan wrote: > As to the drift problem, I reliably reproduce it, too, but it's a bug > somewhere in kvm_clock, and the new hyperv ref tsc page now demonstrates > it by virtue of relying on kvm_clock's values. On my machine I observe > as much as +14 ppm and I'll try to chase it down, but this is > independent of the hyperv ref tsc page patchset. A simple demonstration of it: in a CentOS 7.2 x86_64 guest: # dmesg | grep -Fw tsc: [ 0.000000] tsc: Detected 3411.482 MHz processor [ 2.192473] tsc: Refined TSC clocksource calibration: 3411.532 MHz The first value is derived from the kvm_clock's tsc_to_system_mul and tsc_shift, and matches hosts's vcpu->hw_tsc_khz. The second is calibrated using emulated HPET. The difference is those +14 ppm. This is on i7-2600, invariant TSC present, TSC scaling not present. I'll dig further but I'd appreciate any comment on whether it was within tolerance or not. Roman.