From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH kvm-unit-tests] KVM: x86: add hyperv clock test case Date: Fri, 22 Apr 2016 20:08:47 +0200 Message-ID: <571A68AF.1030907@redhat.com> References: <1453989899-30351-1-git-send-email-pbonzini@redhat.com> <20160128162206.GA29344@rkaganb.sw.ru> <56B22CB4.9090404@redhat.com> <20160421170157.GA16360@rkaganb.sw.ru> <20160422133240.GA9108@rkaganb.sw.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Roman Kagan , kvm@vger.kernel.org, "Denis V. Lunev" , Marcelo Tosatti Return-path: Received: from mail-yw0-f194.google.com ([209.85.161.194]:33728 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753688AbcDVSIr (ORCPT ); Fri, 22 Apr 2016 14:08:47 -0400 Received: by mail-yw0-f194.google.com with SMTP id o63so16488473ywe.0 for ; Fri, 22 Apr 2016 11:08:47 -0700 (PDT) In-Reply-To: <20160422133240.GA9108@rkaganb.sw.ru> Sender: kvm-owner@vger.kernel.org List-ID: On 22/04/2016 15:32, Roman Kagan wrote: > 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. The solution to the bug is to change the Hyper-V reference time MSR to use the same formula as the Hyper-V TSC-based clock. Likewise, KVM_GET_CLOCK and KVM_SET_CLOCK should not use ktime_get_ns(). Paolo